CPSC 327 Data Structures and Algorithms Spring 2024

Homework 4
due Mon 2/5 in class

Draw the tree resulting from each insertion/removal step. If swaps are needed, swap the element with its successor.

  1. Insert the elements 45, 85, 5, 35 into the BST shown.


  2. Remove the elements 40, 60, 30, 50 from the BST shown.