Heap Explained - Algorithms & Data Structures #20

preview_player
Показать описание
Today we will look at the heap data structure, which is useful when we want to implement an efficient priority queue.

◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
📚 Programming Books & Merch 📚

🌐 Social Media & Contact 🌐

🖥️ My Coding Setup 🖥️

Рекомендации по теме
Комментарии
Автор

Thank you so much! You teach better than my teacher who has a degree in computer science!

combatantchunk
Автор

Very very thanks man.. I checked so many videos but this one most clear one.

almanduku
Автор

Thank you! Amazing introduction, very visual and easy to comprehend!

igorbo
Автор

Thank you, your explanations were very useful.

Marwan-ohtk
Автор

Awesome video. Please make a series of C language

elearningforall
Автор

First of all, I am 1/3 through. Thanks for making this. So a Binary Tree is good for only popping the ‚most important‘ node first and then retrieving the next? Am I correct to assume its not designed to be searched for values since you said left child may be greater than right child and vice versa so its unclear which path to follow to retrieve a target value.

MadpolygonDEV
Автор

4:37
Question - how do you find the lowest, available node of the tree, where you should insert the data? It seems simple enough to do if one has implemented the heap with a normal list, in that case you would literally just pick the last spot in the last, but if you're using an actual tree structure it seems to be a bit more difficult. The only obvious way I can think of would be to recursively search through the tree, until you find the correct spot, or maintaining some counter of where the lowest spot is. Both of those seem rather clunky, though. You'd think That there should be some simple and quick way to find the last spot of the tree

Ashadow
Автор

Just found out that in the "Competitive Programming Book" Ed. 4, in order to explain the Priority Queue, they used the same example Heap as you xd

laijie
Автор

Thanks for the video. I had few questions. For Heapify-Up, a complexity of log(n) makes sense to me because we just compare with the immediate parent. But for Heapify-Down, before making comparison with the immediate child, we need to first find the largest child, which I think is another comparison. So how is the complexity still log(n) ?
Also, am I correct when I say that both enqueue & dequeue operations occur in log(n) time ?

vineetbhat
Автор

thanks for the explaination and great fucking arms brother!

kadelchess
Автор

The binary tree is highly politically charged, each child has a left and a right, which in turn have also a left and a right... Dialectic ultra level.

kahnfatman
welcome to shbcf.ru