Java Visitor Pattern

  • + 0 comments

    This is not true:=> It is guaranteed that the tree is rooted at node.

    The first hidden test case reveals that the data is supposed to have a 2 4 edge where 2 is not a child of the root node (1) at all, which means that it cannot be traversed starting from the root node. In other words there is no edge 1 2 relationship so the given 2 4 edge is illegitimate.