Bubble sort like algorithms:
void bubble_sort(double* nums, int len);
void bubble_sort_optimised(double* nums, int len);
void bubble_sort_improved(double* nums, int len);
void bubble_sort_recursive(double* nums, int len);
void coctail_sort(double* nums, int len);
void select_sort(double* nums, int len);
void insert_sort(double* nums, int len);
void quick_sort(double* nums, int len);
void merge_sort(double* nums, int len);
I wanted to find out, how much time it takes each algorithm to sort an array, so I tested it. Each algorithm sorts ascending array, descending array and array with random numbers.
Bubble sort algorithms take a while, so I tested them with only 100.000 numbers.
There are the results:
Then I tested all other algorithms, this time with 1.000.000 numbers:
- Author: Martan03
- GitHub repository: SortingAlgs
- Author website: martan03.github.io