[prev] 69 [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