Skip to main content
Engineering LibreTexts

13.7: One more exercise

  • Page ID
    13237
  • In the previous exercise you didn’t have to implement remove, but you might want to try it. If you remove a node from the middle of the tree, you have to rearrange the remaining nodes to restore the BST property. You can probably figure out how to do that on your own, or you can read the explanation at http://thinkdast.com/bstdel.

    Removing a node and rebalancing a tree are similar operations: if you do this exercise, you will have a better idea of how self-balancing trees work.