Question: Task 3 . 4 : void BST::remove ( const Animal * a ) Remove an animal from the BST . The steps are similar to
Task :
void BST::removeconst 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 children, "move" the linked list from the minimumvalue node of the right BST to the current node, and remove the old minimumvalue 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
