• + 0 comments

    The problem has a problem: How can the two lines "5 1" and "1 2" both mean 1 is the root? Either we infer that 1 is always the root, or that smaller is always the root, but left --> right clearly doesn't work. The paths clearly have a direction, because if the paths were bidirectional, then any add query would add to all nodes.