Hi,
I am facing doubt in the clarification in the ques language … I mean for eg lets say if I reach at the node which is supposed to be deleted as per ques … so what happens to the subTree of that particular node … Do the all nodes in the subtree also get destroyed in the same or they still remain after deleting this node and sort of edges merge ?
Basically if u didnt understand the whole doubt … in simple words ,what happens to the subtree of a node which is supposed to be deleted
Clarification in respects to amit and the Tree
@prabh1601,
Obviously, you would have to delete the whole subtree, when deleting a node, otherwise there would be no use of deleting the node, the vertex you were trying to make stable, would still be unstable.
In short, yes you would have to delete the whole subtree, if you decide to delete a vertex.
It doesnt neccessarily means that my node would still be unstable … lets say i start getting negative edges … what then … my node would become stable at one moment … since i want min edges to be deleted … I dont think deleting the whole sub tree would be great idea
@prabh1601,
Yes you are correct about the case of negative edges, but still it is given in the problem,
Thus Amit decided to remove some of tree leaves until there will be no any unstable vertex left in the tree
So he will only delete a leaf node, and not one that is not leaf by now.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.