## 题目列表 - [208. 实现 Trie (前缀树)](https://github.com/ShannonChenCHN/algorithm-and-data-structure/issues/29#issuecomment-803279383) (难度中等)⭐️ - [单词查找](https://github.com/ShannonChenCHN/algorithm-and-data-structure/issues/29#issuecomment-803279353) - [211. 添加与搜索单词 - 数据结构设计](https://github.com/ShannonChenCHN/algorithm-and-data-structure/issues/29#issuecomment-808744801)(难度中等)⭐️ - [212. 单词搜索 II](https://leetcode-cn.com/problems/word-search-ii/)(难度困难)⭐️ - [692. Top K Frequent Words](https://leetcode.com/problems/top-k-frequent-words/)(难度中等) - [leetcode刷题总结之前缀树](https://blog.csdn.net/qq_43152052/article/details/101109415) ### 总结: 1. 需要掌握 Trie 的实现 - 需要注意的是 Trie 和多叉树的区别,建议画图结合图来看。 - 记住 [208 题](https://github.com/ShannonChenCHN/algorithm-and-data-structure/issues/29#issuecomment-803279383) 的模板代码 - 节点结构 - 插入单词 - 查找单词 - 前缀匹配 2. 简单概括 Trie 的应用就是:一次建树,多次查询 - 搜索引擎关键词输入的自动联想 - 拼写检查 - IP 路由地址前缀匹配 3. Trie 的性质 - Trie 的形状和单词的插入或删除顺序无关,也就是说对于任意给定的一组单词,Trie 的形状都是唯一的。 - 查找或插入一个长度为 L 的单词,访问 next 数组的次数最多为 L+1,和 Trie 中包含多少个单词无关。 - Trie 的每个结点中都保留着一个字母表,这是很耗费空间的。如果 Trie 的高度为 n,字母表的大小为 m,最坏的情况是 Trie 中还不存在前缀相同的单词,那空间复杂度就为 O(m^n)。
题目列表
总结: