filmov
tv
Heap Sort + Step by Step Coding + Time and Space Complexity + Priority Queue - CS Lecture Ep 6

Показать описание
Heap Sort is a classic and very efficient sorting algorithm that has a wide range of practical uses in both academia and industry.
Heap Sort combines the better attributes of both insertion sort and merge sort in that:
it's like insertion sort, but unlike merge sort: it sorts in place;
it's like merge sort, but unlike insertion sort: its time complexity is O(nlgn).
The data structure backing heap sort, i.e. a max heap, is one of the most important data structures ever invented in computer science and unleashes the power of computation and algorithms to solve huge and complex problems in a very efficient manner.
Time complexity: O(nlogn) where n is the number of elements in the input array that need to be sorted.
Space complexity: O(1), we only need constant extra memory to perform this algorithm.
Please do check it out, play with it, using different input sets to help you deeply understand this famous algorithm.
⭐ Support my channel and connect with me:
// TOOLS THAT I USE:
// MY FAVORITE BOOKS:
My ENTIRE Programming Equipment and Computer Science Bookshelf:
And make sure you subscribe to my channel!
Your comments/thoughts/questions/advice will be greatly appreciated!
#heapsort #insertionsort #mergesort #sortingalgorithm #algorithms #softwareengineering #leetcode #coding #interview #SDE #SWE #SiliconValley #programming #datastructures