Content deleted Content added
Modified and reformatted the algorithm as it was incorrect. |
Formatting |
||
Line 35:
==== Algorithm for adding a symbol ====
leaf_to_increment = NULL
IF (
Extend P by adding two children
Left child becomes new NYT and right child is the new symbol leaf node
leaf_to_increment = Right Child of
ELSE
Swap
IF (new
leaf_to_increment =
WHILE (
Slide_And_Increment(
IF (leaf_to_increment != NULL)
Slide_And_Increment(leaf_to_increment)
====
previous_p = parent of p
wt = weight of p
IF (p is an internal node)
Slide
wt += 1
p = previous_p
ELSE
Slide
wt += 1
p = new parent of p.
|