Sample implementation of trie data structure