Right view of subtree using bfs (levelorder)

sir mera code sublime m sahi work raha hai magar coding block ide m code dumped dikhaa raha hai
sir aisa kyu

Hello @YASHMATHURIA123,

I have corrected to mistakes in your code:

But, the logic for right view is also incorrect.
I don’t understand the reason to use dequeue.

Suggestion:
Watch this video. This will help.