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
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
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
one correction --- while ( k 0) this should be while ( k
0)
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
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