We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Is the input format correct?
It has been said that the tree is rooted at vertex 1
But the sample input seems to have nodes directed to vertex 1
5 2
1 1 -1 -1 -1
1 2
2 3
4 1
4 5
As you can see below, if I construct the tree 4 will be the root
Please clarify
Tree Pruning
You are viewing a single comment's thread. Return to all comments →
Is the input format correct? It has been said that the tree is rooted at vertex 1 But the sample input seems to have nodes directed to vertex 1 5 2 1 1 -1 -1 -1 1 2 2 3 4 1 4 5 As you can see below, if I construct the tree 4 will be the root Please clarify