We provide a collection of sorting algorithms, including:
- std::sort
- std::stable_sort
- Bubble Sort (with different optimizations)
- Insertion Sort
- Selection Sort
- Heap Sort
- Merge Sort
- Quick Sort (Hoare / Lomuto) (with different optimizations)
- PDQ Sort
We provide a benchmark framework to test the performance of the sorting algorithms. The testing framework is consists of different test patterns, which can be easily customized by users.
The framework can visualize the distribution of the test data, and compare the performance of different sorting algorithms. It is easy to extend any part of the framework by specializing the template classes.
We provide a cross-platform build system with CMake and Ninja. The project can be easily built on both UNIX-based systems and Windows, with the scripts provided in the repository.
Please check Env Setup Guide for Linux or Env Setup Guide for Windows for more a detailed guide.
Run following command to build the required libs:
bash scripts/build-libs.sh
Note that initializing git submodules may failed on windows.
If you encounter any error, please usegit bash
instead.
.\scripts\build-libs.ps1
The generated libs should be in ./libs
directory.
Run following command to build MySort:
bash scripts/build.sh
.\scripts\build.ps1
You will find a binary file in ./bin
directory.
Execute the binary file and the results will be printed on the screen.
To do...