Heap Sort | C++ | Heaps | Sorting Techniques [ Algorithm + Code explanation]
Автор: Krishna Teaches
Загружено: 2020-10-17
Просмотров: 8615
Описание:
This video contains a detailed explanation of Heap Sort, along with code in C++.
Heapsort is a comparison based sorting technique based on Binary Heap data structure. It is similar to selection sort where we first find the maximum element and place the maximum element at the end. We repeat the same process for the remaining elements.
Why array-based representation for Binary Heap?
Since a Binary Heap is a Complete Binary Tree, it can be easily represented as an array and the array-based representation is space-efficient. If the parent node is stored at index I, the left child can be calculated by 2 * I + 1 and right child by 2 * I + 2 (assuming the indexing starts at 0)
Time Complexity: O(nlogn)
Space Complexity: O(1)
Complete Code:
https://github.com/krishna-gavas/Comp...
Intro Music :
• Видео
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: