i am getting a wrong output.
Please look into it.
Median in a stream of running integers
logic is correct
but there is one mistake at line no 31 and 50
you have written
med=(leftheap.top()+rightheap.top()/2);
which is wrong
correct statement is
med=(leftheap.top()+rightheap.top())/2;
closing brace comes earlier
Modified Code
if you want to ask something about this feel free to ask
i hope this helps
if yes show your response with
and donβt forgot to mark doubt as resolved
1 Like