Binary Search Tree: Remove: Coding

 

The goal for this exercise is to implement the ‘Remove’ method of a binary search tree.

 

Given your previous exercises to familiarize yourself with the BST's remove method, I want you to attempt at coding up the remove (aka "delete") method.  I'd recommend building off of the starter project that was used in class, or else what you coded up in class, rather than redoing everything from scratch.

 

What you need to do for this exercise: 

1.    In the provided starter solution, in the PCE_ForTests project, you should find a class named BST.  This class provides some simple test code for your Remove method.  The BST class itself contains all the logic for the binary search tree class, and is where you’ll spend most of your time during this exercise.

2.    You must complete & turn in a BST.Remove method that can do each of the following things:

a.    Removing a node that has no children

b.    Removing a node that has one child node

c.    Removing a node that has two children

3.    Once you’ve done this, all the tests in the BST_Remove class should pass.