An open API service indexing awesome lists of open source software.

https://github.com/micahondiwa/sorting_algorithms

Implementing different sorting algorithms in C.
https://github.com/micahondiwa/sorting_algorithms

algorithm algorithms sort sorting sorting-algorithms

Last synced: 6 months ago
JSON representation

Implementing different sorting algorithms in C.

Awesome Lists containing this project

README

          

C - Sorting algorithms & Big O

- A project during my Full Stack Software Engineering studies at [ALX Africa](https://www.alxafrica.com/software-engineering-2022/), a course offered by [Holberton School](https://www.holbertonschool.com/).

## Technologies
- Files written in ```vi```, ```vim,``` and ```emacs``` editors.
- C files compiled using ```gcc 9.4.0```.
- C files wriiten according to the betty coding style. Checked using [betty-style.pl](https://github.com/holbertonschool/Betty/blob/master/betty-style.pl) and [betty-doc.pl](https://github.com/holbertonschool/Betty/blob/master/betty-doc.pl).
- Files tested on ```Ubuntu 20.04``` LTS using ```gcc```.

## Files

| Filename | Description |
| --- | --- |
|[0-bubble_sort.c](0-bubble_sort.c)|Write a function that sorts an array of integers in ascending order using the [Bubble sort](https://intranet.alxswe.com/rltoken/awhP8BhtkGi-lwmMc2-KAw) algorithm|
|[1-insertion_sort_list.c](1-insertion_sort_list.c)|Write a function that sorts a doubly linked list of integers in ascending order using the [Insertion sort](https://intranet.alxswe.com/rltoken/GocxRKbPdsmERXeOHMCO2w) algorithm.|
|[2-selection_sort.c](2-selection_sort.c)|Write a function that sorts an array of integers in ascending order using the [Selection sort](https://intranet.alxswe.com/rltoken/SEbg0fBEraioQcl-igvUSw) algorithm.|
|[3-quick_sort.c](3-quick_sort.c)|Write a function that sorts an array of integers in ascending order using the [Quick sort](https://intranet.alxswe.com/rltoken/_pBTrH0Xyo4BRmQn4CtnMg) algorithm.|
|[100-shell_sort.c](100-shell_sort.c)|Write a function that sorts an array of integers in ascending order using the [Shell sort algorithm](https://intranet.alxswe.com/rltoken/FdpP4Qin3iDAaz1kuPD2Kg), using the ```Knuth sequence```|
|[101-cocktail_sort_list.c](101-cocktail_sort_list.c)|Write a function that sorts a doubly linked list of integers in ascending order using the [Cocktail shaker sort](https://intranet.alxswe.com/rltoken/bwa4mHfUbbWTB8J2OIHvpA) algorithm.|
|[102-counting_sort.c](102-counting_sort.c)|Write a function that sorts an array of integers in ascending order using the [Counting sort](https://intranet.alxswe.com/rltoken/ChcoDSCqnJHGC-qrSPEGHQ) algorithm.|
|[103-merge_sort.c](103-merge_sort.c)|Write a function that sorts an array of integers in ascending order using the [Merge sort](https://intranet.alxswe.com/rltoken/8sZ3nAhd_YLNzHCgNbbf8A) algorithm.|
|[104-heap_sort.c](104-heap_sort.c)|Write a function that sorts an array of integers in ascending order using the [Heap sort](https://intranet.alxswe.com/rltoken/YKYRdSdomaVkNrtNv1KS6Q) algorithm.|
|[105-radix_sort.c](105-radix_sort.c)|Write a function that sorts an array of integers in ascending order using the [Radix sort](https://intranet.alxswe.com/rltoken/pBsj4j_AF_mJAgNZWmX3VQ) algorithm|
|[106-bitonic_sort.c](106-bitonic_sort.c)|Write a function that sorts an array of integers in ascending order using the [Bitonic sort](https://intranet.alxswe.com/rltoken/N-bjAbxm5yr4DoeIDz5lLw) algorithm|

### Other Files
```* -O``` Files : The big ```O``` notations of the time complexity of the each algorithm, with 1 notation per line:
- 1. in the best case
- 2. in the average case
- 3. 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)```
- …