This project implements and benchmarks multiple sorting algorithms in C++. It allows the user to generate arrays of different sizes and types (random, sorted, reversed), choose a sorting algorithm, and see detailed results including the original array, the sorted array, execution time, and swap count.
- sorting.h / sorting.cpp - Declaration and Implementation of 6 sorting algorithms
- helperfuncs.h / helperfuncs.cpp - Swap, Print Array, Generate Array, Benchmark
- main.cpp - User Interface (algorithm and array selection, displaying results)
- Bubble Sort
- Insertion Sort
- Selection Sort
- Merge Sort
- Quick Sort
- Heap Sort
While building this project I learned:
- How to implement and compare multiple sorting algorithms in C++
- How to use the library to measure execution time accurately
- Convert sorting algorithms and helper functions into C++ templates to support multiple data types
- Add more sorting algorithms
- Improve user interface