-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBigOSortingAlgorithms.txt
18 lines (17 loc) · 1.21 KB
/
BigOSortingAlgorithms.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Algorithm | Best Case | Average Case | Worst Case | Space Complexity
---------------|------------|--------------|-------------|--------------------
Selection Sort | O(n²) | O(n²) | O(n²) | O(1)
---------------|------------|--------------|-------------|--------------------
Insertion Sort | O(n) | O(n²) | O(n²) | O(1)
---------------|------------|--------------|-------------|--------------------
Bubble Sort | O(n) | O(n²) | O(n²) | O(1)
---------------|------------|--------------|-------------|--------------------
Shell Sort | O(n log n) | O(n^(3/2)) | O(n²) | O(1)
---------------|------------|--------------|-------------|--------------------
Quick Sort | O(n log n) | O(n log n) | O(n²) | O(log n)
---------------|------------|--------------|-------------|--------------------
Merge Sort | O(n log n) | O(n log n) | O(n log n) | O(n)
---------------|------------|--------------|-------------|--------------------
Bucket Sort | O(n + k) | O(n + k) | O(n²) | O(n + k)
---------------|------------|--------------|-------------|--------------------
Radix Sort | O(nk) | O(nk) | O(nk) | O(n + k)