first step towards increasing efficiency - implemented generic base class TrieNode<T> that denotes a node in the resulting trie