Skip to content

#199 - Binary Tree Right Side View

MediumBinary Tree - BFS
Open on LeetCode

Given the root of a binary tree, return the values of the nodes you can see when looking at the tree from the right side, ordered from top to bottom.

InputOutput
root = [1,2,3,null,5,null,4][1,3,4]
root = [1,null,3][1,3]
root = [][]

Released under the MIT License.