Skip to content

micahondiwa/sorting_algorithms

Repository files navigation

C - Sorting algorithms & Big O

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 and betty-doc.pl.
  • Files tested on Ubuntu 20.04 LTS using gcc.

Files

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

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
    1. in the average case
    1. 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)

About

Implementing different sorting algorithms in C.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages