Print tree right view

i am not getting why it is printing the full tree than the only right view which we want.

@mittali your logic is correct but you are not taking input correctly
Coding Blocks IDE
this is the correct way to take in input when we need to consider a level of nodes first but your code was going deeper in levels without completing the current level
if your issue is not solved feel free to ask and if clear please mark my experience

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.