Concept Flow - Vertical Order Traversal of Binary Tree
Start at root node
Assign horizontal distance = 0
Use queue for BFS traversal
Dequeue node
Add node value to map at its horizontal distance
Enqueue left child with hd-1
Enqueue right child with hd+1
Repeat until queue empty
Sort keys of map
Output values in order of sorted keys
Traverse the tree level by level, track horizontal distance (hd) for each node, group nodes by hd, then output groups sorted by hd.