Successive Insertions and Deletions

We know that nearly balanced trees are best because finding an element, insertion, and deletion, all run in O(h), which is tex2html_wrap_inline268 if the tree isn't too stringy.

But even if we start off with a nice balanced tree, it might not be balanced anymore after a sequence of insertions and deletions.

Next time: look at a way of implementing these operations so that the tree stays balanced (on average).


next up previous
Next: LISTING LARGEST ELEMENTS Up: BINARY SEARCH TREES Previous: Where is the Successor?