Vertical Print Binary Tree

https://ide.codingblocks.com/s/67580 MY code is giving a run-error in 1 test case. pls help on this

https://ide.codingblocks.com/s/67606 2 Even this solution is giving same error !
Help

for this input your code is producing run error
1 1125212117 -1 -1 -1
either you can add comments in your code so that i can understand your code
or you can complete this question with a less complex logic

Ohh never mind I got it.
Just that in the while loop there should be a check that if queue is not empty.

Thanks