Add ternary search tree implementation.