CPSC 327 Data Structures and Algorithms Spring 2024

Homework 6
due Fri 2/9 in class

Draw the tree resulting from each insertion/removal step. If swaps are needed, swap the element with its successor. When splitting a node, promote the leftmost middle element.

  1. Insert the elements 5, 16, 22, 45, 2, 10, 18, 30, 50, 12, 47 into an initially-empty 2-4 tree.

  2. Remove the elements 75, 50, 100, 65, 40, 5, 60, 80 from the 2-4 tree shown.