Skip to content

Latest commit

 

History

History
17 lines (15 loc) · 902 Bytes

README.md

File metadata and controls

17 lines (15 loc) · 902 Bytes

0x1B. C - Sorting algorithms & Big O

0. Bubble sort

0-bubble_sort.c sorts an array of integers in ascending order using the Bubble sort algorithm

  • Prototype: void bubble_sort(int *array, size_t size);
  • 0-O is the big O notations of the time complexity of the Bubble sort algorithm, with 1 notation per line:
    • in the best case
    • in the average case
    • in the worst case

1. Insertion sort

1-insertion_sort_list.c sorts a doubly linked list of integers in ascending order using the Insertion sort algorithm

  • Prototype: void insertion_sort_list(listint_t **list);
  • 1-O is the big O notations of the time complexity of the Insertion sort algorithm, with 1 notation per line:
    • in the best case
    • in the average case
    • in the worst case