- BubbleSort
- ShakerSort
- SelectionSort
- GnomeSort
- OddEvenSort
- InsertionSort
- QuickSort
- MergeSort
- CombSort
- HeapSort
- ShellSort
- Add this library to any of your projects, using the Solution Explorer -> Add -> Existing Project by right-clicking on the Solution Explorer.
or
-
Build this library, using the Solution Explorer -> Build Solution by right-clicking on the Solution Explorer.
-
Copy the created SortingLibrary.dll file to the folder of your project, where the executable file (.exe) is located.
-
Add reference to SortingLibrary.dll file, using the Reference -> Add Reference by right-clicking on the Reference in Solution Explorer.
Use methods of the Sorting
Class (the facade pattern):
Available methods | Parameters | Description |
---|---|---|
Sort |
T[] arrayForSort, ISortingMethod sortingMethod |
Sorting an array using the selected method where T:IComparable |
GetRandomArray |
uint length, int minValue, int maxValue |
Create and get an array |
GetErrorIndex |
T[] arrayForCheck |
Check the array and get the index of the wrong element where T:IComparable |
Get the sorting time using the Time
property of the Sorting
Class.
var arrayForSort = Sorting.GetRandomArray<int>(100, 0, 100);
Sorting.Sort(arrayForSort, new BubbleSort(());
errorIndex = Sorting.GetErrorIndex(arrayForSort);
var usedTime = Sorting.Time;
MIT License Copyright (c) 2020 Artem Glushkov