add implementation of ternary search tree, version 1