Re: Algorithm to find break in contiguity



robert maas, see http://tinyurl.com/uh3t said:

From: use...@xxxxxxxxxxxxxxx
I need an efficient algorithm for the following problem:
If you have unique N-1 numbers in the range 1 to N, find the
missing number.

What's best depends almost entirely on how your original data is
given to you. If it's stored in a disk file, you probably can't
save any significant time by jumping around doing a binary search,

Given that two O(n) solutions have already been given elsethread (which
don't depend on how the original data is supplied), why would he want an
O(n log n) solution anyway?

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
.