Sorting algorithm consists of a set of predefined procedures whose main purpose is, as the name suggests, to sort a collection of objects based on some arbitrarily defined criteria. This repository was created for mainly educational purposes, where my primary objective is to study, understand and broadly exercise sorting algorithms in C language. Exploring new approaches and methodologies for different scenarios will allow me to sophisticate my understanding of different data structures and the indispensability of performative code, further consolidating my programming skills.
All — or almost all — of the ordering functions presented here are perfectly applicable in real project contexts. I also emphasize that this is a learning repository, where each code here represents my own version of the sorting algorithm, which means that not all of them will be implemented in their most efficient version. However, I ensure that each one has been properly tested and implemented to the best of my ability within my current level of understanding.
The test codes used for each sorting algorithm will be placed in the "Tests" folder of this repository.
Below is a table to illustrate the different functions currently available:
Function | Time Complexity | Space Complexity | Stable? | ||
---|---|---|---|---|---|
Best Case | Average Case | Worst Case | Worst Case | ||
Binary Insertion Sort | Yes | ||||
Bubble Sort | Yes | ||||
Comb Sort |
|
No | |||
Double Selection Sort | No | ||||
Insertion Sort | Yes | ||||
Heap Sort | No | ||||
Merge Sort | Yes | ||||
Radix LSD Sort | Yes | ||||
Selection Sort | No | ||||
Shaker Sort | Yes | ||||
Shell Sort |
|
|
No | ||
Quick Sort | No |
Function | Time Complexity | Space Complexity | Stable? | ||
---|---|---|---|---|---|
Best Case | Average Case | Worst Case | Worst Case | ||
Bogo Sort 🤹 | Maybe...? | ||||
Good Enough Sort 💤 | For Sure! | ||||
Sleep Sort 🛏️ | I dunno... | ||||
Stooge Sort 🪼 |
|
|
|
Nope! | |
Surprise Sort 🎉 | Who Knows? |