[prev] 17 [next]

Rebalancing Trees (cont)

New operation on trees:
  • partition(tree,i): re-arrange tree so that element with index i becomes root

[Diagram:Pic/tindex.png]

For tree with N nodes, indices are 0 .. N-1