← 返回 meta 的题目列表Vertical Order Traversal of a Binary Tree
类型:online_judge
Given a binary tree, return its vertical order traversal. Each column of nodes should be returned in order from top to bottom and from left to right. Nodes that are located in the same row and column should be returned according to their order of appearance in the binary tree.
Example 1:
Input: [3,9,20,null,null,15,7]
Output: [[9],[3,15],[20],[7]]
Constraints:
The number of nodes in the tree will be no more than 1000.
The value of each node will be no more than 1000.
Example
Input
[3,9,20,null,null,15,7]