Case study · April 2023
Sorting Algorithms
Bubble, insertion, selection, quick, shell, cocktail shaker, counting, merge, heap and radix sort in C, each with its Big O written down.
Overview
One file per algorithm, on arrays and on doubly linked lists where it makes sense, printing the array after each swap so the behaviour is visible. Each comes with a note on best, average and worst case time complexity.
The point
You can look sorting up in a second. Writing quick sort with the Lomuto partition and then watching it go quadratic on already-sorted input is a different kind of knowing.