This project is a C++ program designed to investigate the efficiency and computational complexity of selected sorting algorithms. It provides implementations, benchmarking, and interactive testing for several classic sorting techniques. Implementation allows to see arrays before and after sorting or to see only the time of sorting - in case of big arrays, printing them could be problematic.
-
Insertion Sort
-
Heap Sort
-
Shell Sort
- Gap sequence: size/2
- Gap sequence: size/5
-
Quick Sort
- Pivot selection: leftmost, rightmost, or middle element
- Ascending and descending order variants
-
Interactive Menu
- Load arrays from file or generate random arrays
- Select and apply any sorting algorithm/variant
- View timing and (optional) sorted/unsorted arrays
- Build the project with your preferred C++ compiler.
- Run the executable.
- Choose an option from the interactive menu:
- Load an array from a file (supports both int and float types)
- Generate a random array of a specified size and type
- Select a sorting algorithm and its variant
- View timing results and sorted arrays
main.cpp
- Program entry point and interactive menuinsertionSort.h/.tpp
- Insertion Sort (with variants)heapSort.h/.tpp
- Heap SortshellSort.h/.tpp
- Shell Sort (with gap sequence variants)quickSort.h/.tpp
- Quick Sort (ascending)quickSortDesc.h/.tpp
- Quick Sort (descending)service1.h/.tpp
- File-based array loading and sortingservice2.h/.tpp
- Random array generation and sortingtimer.h
- Timing utilities