Update TernarySearchTree