Marks :15
: 2 | : 0
You are given a binary tree with n nodes, a numbers is written on each node, -1 represents the null node.
you have to print right view of the tree.
First line contains a single integer n where ($$$1 \le n \le $$$ 2^18).
Second line contains n space separated integers $$$A_i$$$ written on $$$i$$$th node where ($$$-1\le A_i \le n$$$) for all $$$i$$$ such that ($$$1 \le i \le n$$$).
Print the right view of binary tree.
7 1 2 3 -1 5 -1 4
1 3 4
7 1 2 3 4 -1 5 -1
1 3 5
1 1
1
In case 1:
1, 3 and 4 are right view of the given tree.
You need to login to view your submissions.
You need to login to view all submissions.
Result : Executed
Feel something is wrong with the test cases?
Result : Accepted
Test Cases :
But to Run or Submit the Problem, you need to Log In.
Continue to Log InYour challenge has been submitted successfully.
You will get a response soon via WhatsApp or Email.
Do let us know your issue.