What is a Min-Heap?

preview_player
Показать описание
Heaps as a whole are one of the most confusing structures that I encountered when first learning data structures and algorithms. They are very useful in sorting algorithms as well as keeping track of the smallest item in an array, boasting an insanely fast O(1) time complexity of finding the smallest item. This does come at a trade-off of an O(log(n)) time complexity of adding a new node to a min-heap, but the cost is usually justifiable.

Check out my other video on max heaps for information not said in this one!

Let me know in the comments if you want a more in-depth look at min-heaps, including how you would take out an element from a min-heap.
Рекомендации по теме
Комментарии
Автор

Even though id prob go through this in 2 years, ty

PureChaosTTV