Tree right view cpp


why am i getting a wrong output?

@Kush_1312
hello Kushagra,
ur logic for printing right view is correct.

the mistake is in ur build tree function.
u are given a level order traversal and from that u need to build tree.
so pls modify ur build tree function

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.