Re: Algorithm to find break in contiguity
- From: Richard Heathfield <rjh@xxxxxxxxxxxxxxx>
- Date: Mon, 29 Jan 2007 16:38:08 +0000
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.
.
- Follow-Ups:
- Re: Algorithm to find break in contiguity
- From: Arthur J. O'Dwyer
- Re: Algorithm to find break in contiguity
- References:
- Re: Algorithm to find break in contiguity
- From: robert maas, see http://tinyurl.com/uh3t
- Re: Algorithm to find break in contiguity
- Prev by Date: Re: looking for name for data structure
- Next by Date: Analyzing Alg. Runtime
- Previous by thread: Re: Algorithm to find break in contiguity
- Next by thread: Re: Algorithm to find break in contiguity
- Index(es):