Sail E0 Webinar
Question
The following lines talks about deleting a node in a binary tree.(the tree property must not be violated after deletion)
i) from root search for the node to be deleted
ii)_____________________________________
iii) delete the node at _____________________
what must be statement ii) and fill up statement iii)
Options:
A .  ii)-find random node,replace with node to be deleted. iii)- delete the node
B .  ii)-find node to be deleted. iii)- delete the node at found location
C .  ii)-find deepest node,replace with node to be deleted. iii)- delete a node
D .  ii)-find deepest node,replace with node to be deleted. iii)- delete the deepest node
Answer: Option D


We just replace a to be deleted node with last leaf node of a tree. this must not be done in case of BST or heaps.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers