Day-8: Heapsort

Day-8: Heapsort

HeapSort is another popular sorting algorithm.

Heapsort basically uses a heap data structure to reach to the minimum or the maximum element at any time with O(1). However, to have the minimum element at everytime, we need Heapify operation which basically takes O(logn) time.

Applyin the operation for every item in an array, we can sort the array.

Time complexity: O(nlogn)

Here is the link of my C++ implementation of Heapsort: Heapsort

Author face

Abdurrezzak Efe

Bilkent University Bachelor's in CS 2018'

Recent post