C - Sorting algorithms & Big O
- A project during my Full Stack Software Engineering studies at ALX Africa, a course offered by Holberton School.
- Files written in
vi
,vim,
andemacs
editors. - C files compiled using
gcc 9.4.0
. - C files wriiten according to the betty coding style. Checked using betty-style.pl and betty-doc.pl.
- Files tested on
Ubuntu 20.04
LTS usinggcc
.
Filename | Description |
---|---|
0-bubble_sort.c | Write a function that sorts an array of integers in ascending order using the Bubble sort algorithm |
1-insertion_sort_list.c | Write a function that sorts a doubly linked list of integers in ascending order using the Insertion sort algorithm. |
2-selection_sort.c | Write a function that sorts an array of integers in ascending order using the Selection sort algorithm. |
3-quick_sort.c | Write a function that sorts an array of integers in ascending order using the Quick sort algorithm. |
100-shell_sort.c | Write a function that sorts an array of integers in ascending order using the Shell sort algorithm, using the Knuth sequence |
101-cocktail_sort_list.c | Write a function that sorts a doubly linked list of integers in ascending order using the Cocktail shaker sort algorithm. |
102-counting_sort.c | Write a function that sorts an array of integers in ascending order using the Counting sort algorithm. |
103-merge_sort.c | Write a function that sorts an array of integers in ascending order using the Merge sort algorithm. |
104-heap_sort.c | Write a function that sorts an array of integers in ascending order using the Heap sort algorithm. |
105-radix_sort.c | Write a function that sorts an array of integers in ascending order using the Radix sort algorithm |
106-bitonic_sort.c | Write a function that sorts an array of integers in ascending order using the Bitonic sort algorithm |
* -O
Files : The big O
notations of the time complexity of the each algorithm, with 1 notation per line:
-
- in the best case
-
- in the average case
-
- in the worst case
The formats:
O(1)
O(n)
O(n!)
- n square ->
O(n^2)
- log(n) ->
O(log(n))
- n * log(n) ->
O(nlog(n))
- n + k ->
O(n+k)
- …