Sorted hash table (map, dictionary) data structure design

前端 未结 6 836
猫巷女王i
猫巷女王i 2020-12-29 00:14

Here\'s a description of the data structure:

It operates like a regular map with get, put, and remove methods, but has a

6条回答
  •  礼貌的吻别
    2020-12-29 00:30

    Ordered Dictionary

    Recent versions of Python (2.7, 3.1) have "ordered dictionaries" which sound like what you're describing.

    The official Python "ordered dictionary" implementation is inspired by previous 3rd-party implementations, as described in the PEP 372.

    References:

    • collections.OrderedDict documentation for Python 2.7
    • collections.OrderedDict documentation for Python 3.1
    • PEP 372
    • ActiveState Ordered Dictionary recipe for Python ≥ 2.4

提交回复
热议问题