Median In a Stream of Running Integers

I am trying to solve this problem but my code is only passing sample test case. I have implemented the the algorithm according to the video. Can you tell my mistake? My code is : https://ide.codingblocks.com/s/234318

@gourav
This is the solution of the code
You can cross verify the code with this