given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.
for example:
given the following binary tree,
you should return [1, 3, 4].
层次遍历法,找出每一层最右端的结点。
given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.
for example:
given the following binary tree,
you should return [1, 3, 4].
层次遍历法,找出每一层最右端的结点。