Median in a stream of running integer

it is giving error what is wrong in this code

@royprincejmp,
*.size() returns an unsigned int, which may give wrong(unwanted) results on being operated with arithmetic operations. So, please explicitly convert each of your *.size() values to (int)