Running median of a stream

how is the complexity of this algorithm O(log n)?

@sanjana23
Hello Sanjana,
the complexity of this algorithm is nlog(n).
log(n) time complexity is the time complexity of insertion in heap.In total if n elements are there then there will be n insertions performed and therefore total complexity is n*log(n) .

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.