Tree Right View

I am stuck on how to input level order .please help me.

Hi rohit…
The given input works on the idea that if a node is on position i then its child nodes will be on 2i+1 and 2i. if it is -1 then its a NULL value its a valid child which might further have children.

how takes inputs i don’t understand.can u please send input code.

It is explained here …