• + 0 comments

    The idea is that for each node traversed, if that node has a horizontal distance(distance from the centre of the tree) which no other node has had so far, map that horizontal distance to the value of that node.

    It goes down the tree and stores the first nodes which are at all the possible distances from the root