This repository contains sorting algorithms made in C
Bubble sort, sometimes referred to as sinking sort, is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order. The pass through the list is repeated until the list is sorted.
valid on Linux/UNIX operating systems
Use one of these commands to clone the repository
HTTPS: https://github.com/manolobkno08/sorting_algorithms.git
SSH: git@github.com:manolobkno08/sorting_algorithms.git
2. Enter the directory sorting_algorithms
3. Paste the compilation command
gcc -Wall -Wextra -Werror -pedantic 0-bubble_sort.c 0-main.c print_array.c -o bubble
4. run the program
./bubble
Insertion sort is a simple sorting algorithm that builds the final sorted array one item at a time. It is much less efficient on large lists than more advanced algorithms such as quicksort, heapsort, or merge sort.
valid on Linux/UNIX operating systems
Use one of these commands to clone the repository
HTTPS: https://github.com/manolobkno08/sorting_algorithms.git
SSH: git@github.com:manolobkno08/sorting_algorithms.git
2. Enter the directory sorting_algorithms
3. Paste the compilation command
gcc -Wall -Wextra -Werror -pedantic 1-main.c 1-insertion_sort_list.c print_list.c -o insertion
4. run the program
./insertion
In computer science, selection sort is an in-place comparison sorting algorithm. It has an O(n²) time complexity, which makes it inefficient on large lists, and generally performs worse than the similar insertion sort.
valid on Linux/UNIX operating systems
Use one of these commands to clone the repository
HTTPS: https://github.com/manolobkno08/sorting_algorithms.git
SSH: git@github.com:manolobkno08/sorting_algorithms.git
2. Enter the directory sorting_algorithms
3. Paste the compilation command
gcc -Wall -Wextra -Werror -pedantic 2-main.c 2-selection_sort.c print_array.c -o select
4. run the program
./select
Quicksort is an in-place sorting algorithm. Developed by British computer scientist Tony Hoare in 1959 and published in 1961, it is still a commonly used algorithm for sorting. When implemented well, it can be somewhat faster than merge sort and about two or three times faster than heapsort.
valid on Linux/UNIX operating systems
Use one of these commands to clone the repository
HTTPS: https://github.com/manolobkno08/sorting_algorithms.git
SSH: git@github.com:manolobkno08/sorting_algorithms.git
2. Enter the directory sorting_algorithms
3. Paste the compilation command
gcc -Wall -Wextra -Werror -pedantic 3-main.c 3-quick_sort.c print_array.c -o quick
4. run the program
./quick
This project was made for holberton school colombia, by Manuel Gomez and Alejandro Alomia.