Generic Trie data structure