987. Vertical Order Traversal of a Binary Tree
Problem Statement
Input: root = [3,9,20,null,null,15,7]
Output: [[9],[3,15],[20],[7]]
Explanation:
Column -1: Only node 9 is in this column.
Column 0: Nodes 3 and 15 are in this column in that order from top to bottom.
Column 1: Only node 20 is in this column.
Column 2: Only node 7 is in this column.Intuition
Links
Video Links
Approach 1:
Approach 2:
Approach 3:
Approach 4:
Similar Problems
Previous236. Lowest Common Ancestor of a Binary Tree / 235. Lowest Common Ancestor of a Binary Search TreeNextHard
Last updated


