Next:
Up:
Previous:
Example
Assign 1 to A (going down)
Assign 0 to B (bottom out)
Assign -1 to C (going up)
These steps are O(1) given initial tree
The depth of the node is stored in C
A + B + C = 0
The net effect of the subtree is 0
Serial:
Run ListPrefix: lg 3n = O(lg n)
here is addition
Work: W =
Next:
Up:
Previous: