Loading repository data…
Loading repository data…
Adib4A / repository
This repository contains implementations of different sorting algorithms in C++ and Python.
This repository contains implementations of different sorting algorithms in C++ and Python.
The goal of this project is to:
| Algorithm | Best Case | Average Case | Worst Case | Space Complexity | Stable |
|---|---|---|---|---|---|
| Bubble Sort | O(n) | O(n²) | O(n²) | O(1) | ✅ |
| Selection Sort | O(n²) | O(n²) | O(n²) | O(1) | ❌ |
| Insertion Sort | O(n) | O(n²) | O(n²) | O(1) | ✅ |
| Merge Sort | O(n log n) | O(n log n) | O(n log n) | O(n) | ✅ |
| Quick Sort | O(n log n) | O(n log n) | O(n²) | O(log n) | ❌ |
| Heap Sort | O(n log n) | O(n log n) | O(n log n) | O(1) | ❌ |
| Counting Sort | O(n+k) | O(n+k) | O(n+k) | O(k) | ✅ |
| Radix Sort | O(nk) | O(nk) | O(nk) | O(n+k) | ✅ |
| Bucket Sort | O(n+k) | O(n+k) | O(n²) | O(n) | ✅ |
| Shell Sort | O(n log n) | O(n log² n) | O(n²) | O(1) | ❌ |
| Pigeonhole Sort | O(n+range) | O(n+range) | O(n+range) | O(range) | ✅ |
The codes were written as part of my Data Structures and Algorithms practice. This repository can serve as a good reference for anyone who wants to compare and learn sorting algorithms.