You are viewing a single comment's thread. Return to all comments →
The 4th line of input is -1 3, which shows the left and right child of node 3. Nodes start from 1. So there is a cycle 3 -> 3. Therefore it is not a tree.
that fourth line of input are children of the right child of root node right....not the children of 3....
Uhm, no... Check the input format. It explains it quite well.