Re: Searching in a random list
- From: Richard Heathfield <rjh@xxxxxxxxxxxxxxx>
- Date: Sun, 23 Nov 2008 08:55:25 +0000
adintimes@xxxxxxxxx said:
Hi all,
Give that I have a list of numbers say from 1 to a million. They are
not stored in any
order. Now if I want to search for a specific number. What is the best
search
methodology to use. What is the best timing that I can achieve. Any
feedback on this will be highly
appreciated.
If they're not in any order, you have to look at every one. There Is No
Free Lunch. If you have to do this more than log n times, consider sorting
them at the outset.
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
.
- References:
- Searching in a random list
- From: adintimes
- Searching in a random list
- Prev by Date: Re: Searching in a random list
- Next by Date: Re: in need of help
- Previous by thread: Re: Searching in a random list
- Next by thread: Re: Searching in a random list
- Index(es):
Relevant Pages
|