This commit is contained in:
2024-12-07 21:07:38 +01:00
parent 2fded76a5c
commit a9676272f2
120 changed files with 15925 additions and 1 deletions

View File

@ -0,0 +1,39 @@
---
date: 02.09.2024
type: mixed
---
## Sorting algorithms and their [complexity](Complexity.md)
| **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](Selection-sort-0.png)
![](selection_sort.gif)
### Insertion sort
![](insertion_sort.gif)
### Bubble sort
![](bubble_sort.gif)
### Quick sort
![](quick_sort.gif)
### Merge sort
![](merge_sort.gif)
Cooler visual:
![](Merge-sort.gif)
### Heap sort
![](Heap_sort.gif)