Skip to content

supa-hub/Radix_Sort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Radix_Sort

A Header only implementation of radix sort using concepts

This repo implements radix sort as a sup::sort() function, which takes the beginning and end iterator of a container which you want to sort.

This works as a drop-in replacement for the std::sort() available in the STL, but works significantly faster
for large containers.

This function works for all signed and unsigned integral types (for e.g: int, long long, unsigned int etc.).

The function is defined in the radix_sort.hpp file.

Concepts in the function parameter

Concepts were introduced in C++20 and in this project they're used to ensure that the types of the iterators passed to sup::sort() are random access and point to values of integral type.

If some of these requirements fail, you'll get a compile-time error.

Testing

compile time tests as well as performance testing is defined in the tests.cpp file.

Build requirements

Min C++ version: 20 (check that your compiler version supports concepts.)

required standard library includes: vector, array, concepts, type_traits

Recommended g++ compiler flags:
-std=c++23
-O3
-fconcepts-diagnostics-depth=5

NOTE: It is possible that depending on your compiler and development environment you'll have to define additional compiler flags or tasks in your IDE/editor.

For example, on VSCode with GCC, you might have to define a c_cpp_properties.json file in your .vscode/ folder with additional config information for concepts to work correctly

About

A Header only implementation of radix sort using concepts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages