字典树
摘要:
```python class TrieNode: def __init__(self): self.nodes=dict() self.is_leaf=False def insert(self,word):#插入单词(字符列表) curr=self for char in word:#单词中的每个字母 if char not in curr.nodes: curr.nodes[char]=Tr 阅读全文
posted @ 2020-03-01 19:45 HolaWorld 阅读(130) 评论(0) 推荐(0) 编辑