implemented pre-order traversal (or sorting) on Trie and corresponding unit tests