Method PrefixCompletion
PrefixCompletion(TernaryTreeNode, String, Int32)
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.
Declaration
public virtual IList<TernaryTreeNode> PrefixCompletion(TernaryTreeNode root, string s, int x)
Parameters
Type | Name | Description |
---|---|---|
TernaryTreeNode | root | a reference to root node of TST. |
System.String | s | prefix query to be auto-completed. |
System.Int32 | x | index of current character to be searched while traversing through the prefix in TST. |
Returns
Type | Description |
---|---|
IList<TernaryTreeNode> | suggest list of auto-completed keys for the given prefix query. |