Oh, very good, better late than never.
This is my pure Python version, it performs get, set and del
operations too in O(1):
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/498195
Working with C such data structure becomes much faster, because it can
use true pointers.

Then another data structure that may be named SortedDict can be
created, that keeps items in their natural order (instead of the
insertion order).

Bye,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to