update trie algorithm