Dictionary...

Isaac To kkto at csis.hku.hk
Fri Sep 6 09:22:57 EDT 2002


>>>>> "Raymond" == Raymond Hettinger <python at rcn.com> writes:

    Raymond> Hello Issac, Try looking at seqdict in the Vaults of Parnassus:
    Raymond> http://home.arcor.de/wolfgang.grafen/Python/Modules/Modules.html

Ah... after I read this it makes sense again now, since Python map is not
comparison based.  Perhaps I've got the wrong idea from the beginning...

    Raymond> Your other ideas were good too.  The auxilliary map of
    Raymond> successors and precessors is likely to be the fastest.  To
    Raymond> efficiently update a sorted python list, try the bisect module.

But difficult to code.  I've to maintain 3 data structures instead of 1.
Well... perhaps time to write a class. =)

Regards,
Isaac.



More information about the Python-list mailing list