← 返回 meta 的题目列表Clockwise Boundary Traversal of Binary Tree Paths
类型:online_judge
meta
Problem: Clockwise View of Binary Tree Paths
Given the root of a binary tree, compute the clockwise view from the bottom-left node to the bottom-right node. It first moves incrementally along the bottom of the tree, then moves up to the root, and then returns to the root decrementally along the top of the tree.
Example binary tree:
1
/ \
3 2
Output: 3, 1, 2
Note: Move from the root to the bottom-left up then left to right along the top back to the root, along the boundary of the tree, clockwise.
Constraints:
Number of nodes does not exceed 1000
Implement this feature to return the clockwise view for a given binary tree.
Example
Input
1,3,2