HomeTrie
Trie
Prefix tree — shared prefixes stored once, fast lookups.
10 shown
- OverviewPrefix tree · shared prefixes stored onceanimatedMedium
- Implement Trieinsert · search · startsWithanimatedMedium
- Practice problems
- Trie Implementation and Operationsinsert, search, startsWithanimatedHard
- Trie Implementation and Advanced OperationsCounts at every nodeanimatedHard
- Longest Word with All PrefixesEvery prefix must itself be a wordanimatedMedium
- Number of distinct substrings in a stringInsert every suffix; count the nodesMedium
- Bit PreRequisites for TRIE ProblemsA binary trie over the bits of a numberEasy
- Maximum XOR of two numbers in an arrayGreedily take the opposite bit at every levelHard
- Maximum Xor with an element from an arraySort both sides and insert as the limit risesHard
- Prefix MatchingWalk the prefix, read the countanimatedMedium