Question: Consider the binary search tree built by inserting the following sequence of integers, one at a time: 5 , 4 , 7 , 9 ,
Consider the binary search tree built by inserting the following sequence of integers,
one at a time:
Which method below will properly remove node from the binary search tree?
Find the in order predecessor IOP of node which is node Remove node
from the tree by setting the right pointer of its parent node to point to the node
pointed to by the left pointer of node Then copy the key and any data from
node to node turning node into a new node and delete the old node
Set the left pointer of node to nullptr, and then delete node
Find the in order predecessor IOP of node which is node Remove node
from the tree by setting the right pointer of its parent node to nullptr. Then
copy the key and any data from node to node turning node into a new node
and delete the old node
Set the left pointer of node to point to the node pointed to by the left pointer of
node and then delete node
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
