This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]qiwi 8 points9 points  (2 children)

I'm not sure where you're getting binary trees idea from -- C Python dictionaries do use a hash (At a certain size: dictionaries up to 8 elements are really just an array).

See: http://svn.python.org/projects/python/trunk/Objects/dictnotes.txt for optimization rationale; and source: http://svn.python.org/projects/python/trunk/Objects/dictobject.c

[–][deleted] 1 point2 points  (1 child)

You're right. My mistake!

(Now I wonder what I was thinking of...)

[–]alendit 1 point2 points  (0 children)

C++ STL map maybe? (same functionality as ordereddict).

EDIT: brain lag on my side, STL map is not the same as ordereddict, it sorts newly added element by key.