【文件属性】:
文件名称:trie:trie的python实现
文件大小:3KB
文件格式:ZIP
更新时间:2021-06-05 02:31:14
Python
特里
树数据结构的简单python实现也称为数字树,有时也称为基数树或前缀树。 保留字符串线索时有效。
它是华沙大学“算法和数据结构”学科学期项目的一部分。
字典
您可以将 Trie 用作字典。 字典实现为命令行解析器dictparser.py 。 下面是一些命令:
i word # insert word
r word # remove word from dictionary
f word # print lexicographic number
n l # print lth word
p pref # print number of words starting with prefix pref
a # print all words in lexicographic order
d # print all words in reversed order
【文件预览】:
trie-master
----README.md(742B)
----trie.py(7KB)
----dictparser.py(937B)