help retrieving / storing info in dictionary or gadfly

Greg Jorgensen gregj at pobox.com
Mon Jan 15 01:58:27 EST 2001


I can't think of anything more straightforward and efficient than
keeping a sorted list of keys and using a binary search on it. That's
what I would do, but I'm interested in the other replies you'll get.


In article <93u48n$65t at dispatch.concentric.net>,
  "Bryan Webb" <bww00 at amdahl.com> wrote:
> Hello,
>     I have a dictionary that has records with keys from 1 to 2^128
> I can build a list and sort the keys in order, then search thru the
list of
> sorted keys.
>     If the list has 1,2,3,4,5,7,8,9 and I need to search for 6. 6 is
not in
> the list , so I need the record that is closest to 6 but not greater
than 6.
> Is there a way to further index the list of keys to do this ?
>
> Could I use GADFLY to do this.
>
> Any ideas and help would be appreciated.
>
> Thanks
> bryan Webb
>
>

--
Greg Jorgensen
Portland, Oregon, USA
gregj at pobox.com


Sent via Deja.com
http://www.deja.com/



More information about the Python-list mailing list