Skip to content
This repository was archived by the owner on Mar 22, 2024. It is now read-only.

Latest commit

 

History

History
32 lines (18 loc) · 1.29 KB

File metadata and controls

32 lines (18 loc) · 1.29 KB

17 - Quick sort

  • Quick sort is a divide and conquer algorithm.

  • It picks an element as pivot and partitions the given array around the picked pivot.

Visual Representation

Comparison

Algorithm Best Case Average Case Worst Case Space Complexity
Bubble Sort O(n) O(n^2) O(n^2) O(1)
Selection O(n^2) O(n^2) O(n^2) O(1)
Insertion O(n) O(n^2) O(n^2) O(1)
Recursion O(n log n) O(n log n) O(n^2) O(n)
Merge O(n log n) O(n log n) O(n log n) O(n)
Quick O(n log n) O(n log n) O(n^2) O(log n)

Materials


16 - Merge sort | Home | 18 - Hash Tables