Question: Task 3 . 4 : void BST::remove ( const Animal * a ) Remove an animal from the BST . The steps are similar to

Task 3.4:
void BST::remove(const Animal* a)
Remove an animal from the BST. The steps are similar to the lecture notes with a few differences:
If the node with the "same" value is found, remove it from the linked list.
If the linked list becomes empty, the BSTnode needs to be removed from the BST. This means:
If this node has 2 children, "move" the linked list from the minimum-value node of the right BST to the current node, and remove the old minimum-value node from the right BST.
Else, remove and deallocate this node similar to the lecture example.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!