For those who are wondering: It seems that heaps have a specific use case and that mostly is related to priority queues. This means that taking the top off the heap is dequeuing the item with the min/max priority. Other data structures should be used if you need to do other things. You can remove from anywhere in the heap if you want but its probably not very efficient.
So glad I found this. Dr. Edwards explains these so well. Best I've seen on the internet so far.
love this man. This man and his amazing glass board has made my class so much easier to understand
What if you wanted to remove a particular node? What would the process be then? For example, if I wanted to remove the node with the value of 17.
exactly my question, he spoke as nothing other than root can be removed...
@@mutoso wow dude thnx! where did you find this??
@@mutoso why not always replacing it with A[lastIndex]?
For those who are wondering: It seems that heaps have a specific use case and that mostly is related to priority queues. This means that taking the top off the heap is dequeuing the item with the min/max priority. Other data structures should be used if you need to do other things. You can remove from anywhere in the heap if you want but its probably not very efficient.
5:29 is for max heap only right?