prefix tree Trie construction