You are viewing a single comment's thread. Return to all comments →
I think using a loop here:
while(!low.isEmpty() && !high.isEmpty() && low.peek() > high.peek())
is not needed.
Can simply use one if condition instead of while :
if (!low.isEmpty() && !high.isEmpty() && low.peek() > high.peek())
Seems like cookies are disabled on this browser, please enable them to open this website
Heaps: Find the Running Median
You are viewing a single comment's thread. Return to all comments →
I think using a loop here:
is not needed.
Can simply use one if condition instead of while :