Dictionary...

Isaac To kkto at csis.hku.hk
Fri Sep 6 14:11:15 CEST 2002


Hi,

Some time ago I want to have a dictionary-like type that can support
dictionary operation, plus that given any key, I want to know the
predecessor and successor of any given key efficiently.  I've thought of
using a Python list, but it is impossible to update quickly.  The closest
thing I can think of is an auxillary map that implements the successor and
predecessor functionalities.  But I'm wondering there is anything better.
After all, Python dictionaries are implemented by height balancing tree, so
internally the needed data can be retrieved efficiently.  Any hint?

Regards,
Isaac.



More information about the Python-list mailing list