add the traverse method to traverse from 1 to n
a simple implementation of trie and do some test