data structures - Deleting a node in a binary tree having children -
if have delete node binary tree, how should handle children of node being deleted. e.g. in tree:
100 / 10 / \ 5 20
where 100
root node, 10
left child of 100
, 5
left child of 10
, 20
right child of 10
. after deleting 10
, happen 5
, 20
?
it choice if should after deleting.you want move 1 of child upward on criteria. either of of child take place of parent.
so choice have take solve objective.
Comments
Post a Comment