[Pdx-pm] [SOLUTION] Telephone number sorting
mikeraz at PATCH.COM
mikeraz at PATCH.COM
Fri Sep 27 19:38:29 CDT 2002
On Fri, Sep 27, 2002 at 04:53:02PM -0700, Joshua Keroes typed:
> > Q: What's the fastest, most space-efficient way to sort all
> > of Portland's 503 phone numbers?
>
> A: Use a bit vector. To allocate enough space for all
> 10,000,000 numbers, allocate 10,000,000 bits. [1]
>
> To signify that a telephone number is in use, turn the bit on.
>
> e.g. to indicate that the number 411 is in use, turn the 411th bit on.
Did I miss the begining of this thread or is that solution
unrelated to the problem description?
--
Michael Rasmussen aka mikeraz
Be appropriate && Follow your curiosity
http://www.patch.com/ http://wiki.patch.com/
http://blog.patch.com/sandbox/
The fortune cookie says:
Q: How did you get into artificial intelligence?
A: Seemed logical -- I didn't have any real intelligence.
More information about the Pdx-pm-list
mailing list