Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Sorting Algorithms Part II - Quick Sort and Heap Sort

Quick Sort

Invenred by Tony Hoare in 1959

Quick Sort is a divide and conquer algorithm. It picks the last element as a pivot and partitions the given array around the picked pivot. If an element (pivot) is selected and all the elements are placed minor elements to this left side and all elements greater than this on the right side, the selected item will remain arranged in position.

Time Complexity: O(n log n)

Heap Sort

Heap Sort is a comparison based sorting algorithm. It is an in-place algorithm. It is a non-comparison based sorting algorithm.

Time Complexity: O(n log n)