This project is part of the Holberton School curriculum. It focuses on implementing various sorting algorithms in the C programming language, following strict requirements including the Betty coding style and limited use of standard library functions.
Each algorithm must sort either an array of integers or a doubly linked list, depending on the task, and must follow specific formatting and performance requirements.
All files are compiled on Ubuntu 20.04 LTS using gcc with the following flags:
gcc -Wall -Wextra -Werror -pedantic -std=gnu89| File | Description |
|---|---|
print_array.c |
Prints an array of integers |
print_list.c |
Prints a doubly linked list |
sort.h |
Header file containing all prototypes and type definitions |
2-selection_sort.c |
Implementation of the Selection Sort algorithm |
2-O |
Time complexity of the Selection Sort algorithm |
- Selection Sort
Example using the Selection Sort algorithm:
int array[] = {19, 48, 99, 71, 13, 52, 96, 73, 86, 7};
size_t n = sizeof(array) / sizeof(array[0]);
print_array(array, n);
selection_sort(array, n);
print_array(array, n);- No use of global variables
- No more than 5 functions per file
- Only allowed standard functions:
malloc,free,exit(unless specified otherwise) - All header files must be include-guarded
- Each file must end with a new line
- Chéreau Florian
- Labaldie Jonathan
- Le Boulzec Romain
This project is part of the Holberton School low-level programming curriculum.