Skip to content

Latest commit

 

History

History
13 lines (8 loc) · 666 Bytes

File metadata and controls

13 lines (8 loc) · 666 Bytes

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)