Trie
Animation: https://www.cs.usfca.edu/~galles/visualization/Trie.html it use an Array of TrieNode in every node: TrieNode[] children = new TrieNode[26]
basic: https://leetcode.com/problems/implement-trie-prefix-tree/description/
Template
DFS to build Trie
211-Add and Search Word - Data structure design
Applications
Words dictionary, then look up a word
Extension: numbers, binary
https://leetcode.com/problems/add-and-search-word-data-structure-design/description/ https://leetcode.com/problems/implement-magic-dictionary https://leetcode.com/problems/replace-words/description/ https://leetcode.com/problems/maximum-xor-of-two-numbers-in-an-array
Last updated