python-skiplist:Python 的 SortedDict 和 SortedSet 实现

时间:2021-07-01 18:08:04
【文件属性】:
文件名称:python-skiplist:Python 的 SortedDict 和 SortedSet 实现
文件大小:10KB
文件格式:ZIP
更新时间:2021-07-01 18:08:04
C python-skiplist 跳过列表是可以用来代替平衡树的数据结构。 它们更容易实现并且通常更快。 这个库使用跳过列表来实现 Python 的 SortedDict 和 SortedSet 数据类型。 SortedSet 是用 C 实现的,它使用 CPython C API,而 SortedDict 是 SortedSet 之上的一个瘦包装器。 下面是几个例子: >> > from skiplist import SortedSet , SortedDict >> > d = SortedDict ({ 'elma' : 1 , 'armut' : 2 , 'kel' : 3 , 'mahmut' : 4 }) >> > d SortedDict ({ 'armut' : 2 , 'elma' : 1 , 'kel' : 3 , 'mahmut' : 4 }) >> > de
【文件预览】:
python-skiplist-master
----benchmarks.py(1KB)
----.travis.yml(333B)
----skiplist()
--------sortedsetobject.c(15KB)
--------__init__.py(1KB)
----setup.cfg(40B)
----setup.py(960B)
----README.md(2KB)
----tests()
--------test_sorteddict.py(3KB)
--------test_sortedset.py(4KB)
--------__init__.py(0B)
----.gitignore(174B)

网友评论