[algogeeks] Re: programming pearls duplicate value

2006-05-30 Thread Terry
Gene wrote: I'm sorry, but the response below is wrong on several levels. See notes. C Erler wrote: Because there are infinite integers, there is no need for a list of 4,300,000,000 of them to contain a duplicate. If there are 4,299,999,999 choices, there will be one duplicate.

[algogeeks] Re: programming pearls duplicate value

2006-05-30 Thread Googmeister
Terry wrote: This problem is from the book programming pearls . Can anyone explain me the soln. How does he do it. Given a file containing 4,300,000,000 integers, how can you find one that appears at least twice? (Explain, first, why this must happen.) Binary search finds an element

[algogeeks] Re: programming pearls duplicate value

2006-05-30 Thread Gene
Terry wrote: Gene wrote: I'm sorry, but the response below is wrong on several levels. See notes. C Erler wrote: Because there are infinite integers, there is no need for a list of 4,300,000,000 of them to contain a duplicate. If there are 4,299,999,999 choices, there will be

[algogeeks] Re: programming pearls duplicate value

2006-05-29 Thread C Erler
Because there are infinite integers, there is no need for a list of 4,300,000,000 of them to contain a duplicate. If there are 4,299,999,999 choices, there will be one duplicate. Because the solution uses binary search, the list is sorted. So, the full problem is probably something like the