OrderedDict是树吗?

Are*_*ski 3 python dictionary ordereddictionary

OrderedDict是一个保留项目顺序的集合(插入它们的顺序).我不认为这可以通过哈希表实现(我认为常规字典使用)所以用于实现它的平衡树是什么?

我假设有许多依赖,如Python 2/3和CPython/IPython/others.

Sim*_*ser 13

您可以在CPython的源代码中阅读实现:Lib/collections/__ init__.py,这OrderedDict是在Python中实现的.

它使用双向链表来维护字典中元素的顺序.