Notes/Advanced Algorithms/Sorting algorithms.md
2024-12-07 21:07:38 +01:00

1.0 KiB

date type
02.09.2024 mixed

Sorting algorithms and their complexity

Algorithm Time Complexity
Selection \mathcal{O}(n^2)
Insertion \mathcal{O}(n^2)
Bubble \mathcal{O}(n^2)
Quick \mathcal{O}(n^2) worst case, \mathcal{O}(n\log n) average
Merge \mathcal{O}(n\log n)
Heap \mathcal{O}(n\log n)

Selection Sort

Selection sort

Insertion sort

Bubble sort

Quick sort

Merge sort

Cooler visual:

Heap sort