Simple trie for efficient, frequency-based retrieval.