type trie and add binary search tree