Create ternary-search-tree