Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

Sorting Algorithms

Description

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.


Compilation

All files are compiled on Ubuntu 20.04 LTS using gcc with the following flags:

gcc -Wall -Wextra -Werror -pedantic -std=gnu89

Project Structure

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

Implemented Algorithms

  • Selection Sort

Example Usage

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);

Requirements

  • 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

Author

  • Chéreau Florian
  • Labaldie Jonathan
  • Le Boulzec Romain

License

This project is part of the Holberton School low-level programming curriculum.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages