Finishing with ternary search trees.