Heap Sort Algorithm | Simple Explanation

preview_player
Показать описание
Heap sort is a comparison based, in-place sorting algorithm. We can think of it as an improved version of selection sort as it divides the input into a sorted section and an unsorted section, but interestingly it keeps the unsorted section a max-binary-heap. This helps the heap sort to achieve the worst-case time complexity of O(nlogn).

In this video, we talk about the max-binary-heap, and the heapify function and discuss how to convert an array into a max-binary-heap. Then we will use all of this stuff to understand and implement heap-sort.

If you’re interested in max-heap, min-heap and priority queue as well, this video can help you to understand the underlying data structure.

Chapters:
0:00 Introduction and Agenda
0:50 What is Max-Binary-Heap
1:39 How to store a heap into an array
3:02 Heapify
4:09 Heapify Code
5:35 Building a Max-Binary-Heap
7:28 Build-Max-Heap Code
7:42 Heap Sort
8:45 Heap Sort Code
9:15 Heap Sort Misc

#algorithm #datastructures #datastructure #sorts #sort #heap #python

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

Great video! your explaination was very clear, allowed me to connect the dots that i was missing to understand it fully.

Nil_y
visit shbcf.ru