[algogeeks] 1 to 1 Lack numbers in a stream .. find the missing number

2005-12-20 Thread Uppala Babu
you have been a long input stream of 1 to 1Lakh number in which one number is missing and in place of that number -1 is present, input comes in random order, you have to find the number which is missing and also at what position in the input stream this -1 occurs. Regards Babu

[algogeeks] Re: Given N numbers z value , find x, y such that x + y = z

2005-12-20 Thread Hemanth
Hi, Let me try to slightly present the problem in a different way. 1. First go through the unsorted array and get two smaller arrays. One array containing numbers = z/2 and other array containing numbers z/2 and = z. Other numbers obviously can be ignored. 2. Now 'z' complement(i.e. number

[algogeeks] Re: 1 to 1 Lack numbers in a stream .. find the missing number

2005-12-20 Thread Dhyanesh
This problem has already been solved on this group before. See previous threads for title Missing Numbers. It is done by XORing.-DhyaneshOn 12/20/05, Uppala Babu [EMAIL PROTECTED] wrote: you have been a long input stream of 1 to 1Lakh number in which one number is missing and in place of that

[algogeeks] Re: 1 to 1 Lack numbers in a stream .. find the missing number

2005-12-20 Thread sudhakar-aluri
one correction --- while ( k 0) this should be while ( k 0)

[algogeeks] Partition problem

2005-12-20 Thread pramod
I came across this problem: Given N positive integers, partition these into two disjoint subsets with the same sum of their elements (of course, the problem does not always have a solution). Design an exhaustive search algorithm for this problem. Try to minimize the number of subsets the

[algogeeks] Re: A puzzle with 8 Millions pieces

2005-12-20 Thread adak
By definition, your problem is impossible. You state that each piece is unique, and there are 8 million pieces. A puzzle is solved only when all the pieces are fitting together, properly. You have an impossibility, not a problem, and it can't be solved. Not to mention that a minimum is a