Sorting in C is a simple utility program for sorting numbers written entirely in C. Default sorting algortihm is Quick Sort but following sorting algortihms can be used:
- Insertion Sort
- Bubble Sort
- Selection Sort
- Merge Sort
- Heap Sort
- Counting Sort
- Radix Sort
- Bucket Sort
- Bingo Sort
- Shell Sort
- Tim Sort
- Comb Sort
- Pigeonhole Sort
- Cycle Sort
- Cocktail Sort
- Bitonic Sort
- Pancake Sort
- Bingo Sort
- Gnome Sort
To build the project use:
./build.sh
Generate a file with 10000 numbers and shuffle them
mySort -g original.txt original_shuf.txt 10000
The maximum amount of numbers that can be genereted is restricted to 80% of available memory
Shuffling uses an algorithm to make sure <1% of numbers are consective
Sort the shuffled file using Insertion Sort
mySort -s insertion original_shuf.txt original_sorted.txt
For more commands consult man page
The utility comes with a man page that can be accessed with:
mySort --help
By default, STATS option is turned on which will approximate the time required to sort the file using a certain sorting algorithm
To modify STATS/DEBUG values consult /main.c
NOTE! It becomes innacurate as you increase the amount of numbers to be sorted
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.