Concept Flow - Top View of Binary Tree
Start at root node
Assign horizontal distance = 0
Use queue for level order traversal
For each node dequeued:
Check if horizontal distance
seen before?
If not seen, record node data
Continue until queue empty
Print recorded nodes in order of hd
Traverse the tree level by level, track horizontal distances, record first node at each distance, then print them in order.
