Obs.: Modified to remove CUDA code.
Repository of sorting algorithms in C.
Our program generates and fills arrays in four different ways:
- arrays with totally random elements
- arrays already ordered
- arrays ordered in descending order
- arrays 90% ordered.
Sorting methods implemented
- Selection sort
- Insertion sort
- Shell sort
- Quick sort
- Heap sort
- Merge sort
Run the MAKEFILE
To run the program, type:
./app -a $algorithm -n $number_of_elements -s $state [-P]
- -a sorting algorithm
- -n number of elements
- -s array state
- -P print results
Param | Value |
---|---|
-a | selection |
insertion | |
shell | |
quick | |
heap | |
merge | |
-n | int > 0 |
-s | random |
ascending | |
descending | |
almost | |
-P |