kdn251 / interviews

Everything you need to know to get the job.
https://www.youtube.com/channel/UCKvwPt6BifPP54yzH99ff1g?view_as=subscriber
MIT License
63.68k stars 12.91k forks source link

remove (min/max) heap #10

Closed robinvd closed 7 years ago

robinvd commented 7 years ago

The complexity of remove min/max in a heap is O(log(n)) instead of O(1)

kdn251 commented 7 years ago

Hi Robin, thanks for your feedback. I realized the confusion is I meant to say getMin() is O(1). I'll be sure to add getMin() and change remove() to O(log(n)).