This commit is contained in:
MarcUs7i 2025-05-14 09:01:03 +02:00
parent a04a66c509
commit add23e123e
23 changed files with 1041 additions and 107 deletions

View file

@ -1,9 +1,9 @@
/*----------------------------------------------------------
* HTBLA-Leonding
* ---------------------------------------------------------
* Exercise Number: S07
* Exercise Number: S05
* Title: Sorting support functions
* Author: */<your name>;/*
* Author: Marc Tismonar
* ----------------------------------------------------------
* Description:
* Interface for sorting algorithms
@ -26,7 +26,6 @@ typedef enum {
BUBBLE_SORT,
FIRST_ALGORITHM = BUBBLE_SORT,
INSERTION_SORT,
MERGE_SORT,
ALGORITHM_ENUM_END
} SortingAlgorithm;
@ -36,7 +35,7 @@ typedef enum {
* @param algorithm The sorting algorithm
* @return The name of the algorithm.
*/
<type> get_algorithm_name(<params>);
char* get_algorithm_name(SortingAlgorithm algorithm);
#ifdef LIST_VARIANT
@ -47,7 +46,7 @@ typedef enum {
* @param list The list to initialize.
* @param item_count The number of items to insert.
*/
void init_list_random(<params>);
void init_list_random(IntList list, int item_count);
/**
* Prints the values stored in the given list.
@ -65,7 +64,7 @@ void print_list(char* prefix, IntList list);
* @param criterion The pointer to the function that implements the sorting criterion.
* That function accepts two integer parameters and returns a boolean value.
*/
void sort_list(<params>);
void sort_list(IntList list, SortingAlgorithm algorithm, criterion_fn criterion);
#else /* ARRAY_VARIANT */