
Trie
Shlyan
这个作者很懒,什么都没留下…
展开
-
[Leetcode] 211. Add and Search Word - Data structure design
Problems: https://leetcode.com/problems/add-and-search-word-data-structure-design/ Solution: 本题如果使用hashmap的话,在search时将会很难应付“…ab”的情况 class WordDictionary { class TrieNode { boolean isTrie;...原创 2019-10-17 07:31:48 · 104 阅读 · 0 评论 -
[LeetCode] 208. Implement Trie (Prefix Tree)
Problems: https://leetcode.com/problems/implement-trie-prefix-tree/ Solution: class Trie { // TrieNode是Trie的基本元素 // isTrie判断该字符是否是prefix结束 // children记录字符的child class TrieNode { boolean...原创 2019-10-17 01:16:24 · 90 阅读 · 0 评论