Sorting is one of the most fundamental algorithmic problems within computer science.
There are many tasks (e.g: search, calculate median, find mode, remove duplicates, etc.) that can be implemented much more efficiently once the data is sorted. The wide variety of algorithms gives us a lot of richness to explore, especially when considering the tradeoffs offered in terms of efficiency, space complexity, code complexity, best/worst case inputs, and so on.
The code combines five of the most common sorting algorithms (Insertion, selection, bubble, merge, quick) in addition to an optimised hybrid merge selection sorting algorithm. It also includes a method (findk) that returns the kth smallest element in an array using the partition algorithm.
The text-based user interface generates a random array and sorts that array in all the sorting techniques implemented, and calculates the time spent sorting for each algorithm for a fair comparison.