A trie (pronounced ’try’) is a tree-based data structure optimized for storing and retrieving strings. The name comes from ‘reTRIEval,’ though some pronounce it ’tree’ to emphasize its structure….
Read more →
Every developer reaches for a hash map by default. It’s the Swiss Army knife of data structures—fast, familiar, and available in every language’s standard library. But this default choice becomes a…
Read more →
A suffix trie is a trie (prefix tree) that contains all suffixes of a given string. While a standard trie stores a collection of separate words, a suffix trie stores every possible ending of a single…
Read more →
Standard tries waste enormous amounts of memory. Consider storing the words ‘application’, ‘applicant’, and ‘apply’ in a traditional trie. You’d create 11 nodes just for the shared prefix ‘applic’,…
Read more →