Ternary Search Tree based autosuggest.
-
Inserts a key in TST creating a series of Binary Search Trees at each node.
Auto-completes a given prefix query using Depth-First Search with the end of prefix as source
node each time finding a new leaf to get a complete key to be added in the suggest list.
void
Inserting keys in TST in the order middle,small,big (lexicographic measure) recursively creates
a balanced tree which reduces insertion and search times significantly.
Inserts a key in TST creating a series of Binary Search Trees at each node.
Auto-completes a given prefix query using Depth-First Search with the end of prefix as source
node each time finding a new leaf to get a complete key to be added in the suggest list.