Problem Challenge 2

Right View of a Binary Tree (easy) #

Given a binary tree, return an array containing nodes in its right view. The right view of a binary tree is the set of nodes visible when the tree is seen from the right side.

Created with Fabric.js 1.6.0-rc.1 1 2 3 4 5 6 7 Example 1 Right View: [1, 3, 7]
Created with Fabric.js 1.6.0-rc.1 Exampe 2 Right View: [12, 1, 5, 3] 12 7 1 9 3 10 5

Try it yourself #

Try solving this question here:

Output

0.462s

Tree right view:

Mark as Completed
←    Back
Solution Review: Problem Challenge 1
Next    →
Solution Review: Problem Challenge 2