Implementation of sorting algorithms in c# supporting every numeric data type. You can either include the source-code in your own project, or import the .dll file as reference.
sbyte
*byte
short
ushort
*int
uint
*long
ulong
*double
float
decimal
*
*: C#-Only
Every algorithm takes the unsorted array as parameter and returns the sorted array. Every function is overloaded for very data type, thus you don't have to worry about different names when calling the functions with arrays of different types.
Just add the Sort.cs file to your project folder and use the implemented algorithms via Sort.XX
Add the .dll file as reference to your project
Select ".NET-Assembly" and search your download folder for the provided .dll file.
Select the file and you're ready to go!
The time an algorithm takes to sort a certain array depends on its length. E.g. for short arrays selectionsort might be the best solution, whereas long arrays should always be sorted by quicksort, introsort, etc. (O(n*log(n))).
To find out, which algorithms is the fastest for your task, run the benchmark from the benchmark.cs
file and specify the length of your array.
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the GNU LGPLv3 License. See LICENSE
for more information.
- Julian Schnabel - julianschnabel@outlook.com
- Project Link: https://github.com/SchnJulian/Sorting-Algorithms-CSharp