Method BalancedTree
BalancedTree(Object[], Object[], Int32, Int32, TernaryTreeNode)
Inserting keys in TST in the order middle,small,big (lexicographic measure) recursively creates a balanced tree which reduces insertion and search times significantly.
Declaration
public virtual void BalancedTree(object[] tokens, object[] vals, int lo, int hi, TernaryTreeNode root)
Parameters
Type | Name | Description |
---|---|---|
System.Object[] | tokens | Sorted list of keys to be inserted in TST. |
System.Object[] | vals | |
System.Int32 | lo | stores the lower index of current list. |
System.Int32 | hi | stores the higher index of current list. |
TernaryTreeNode | root | a reference object to root of TST. |