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

@ -3,7 +3,7 @@
* ---------------------------------------------------------
* Exercise Number: S07
* Title: Binary search implementation
* Author: */<your name>;/*
* Author: Marc Tismonar
* ----------------------------------------------------------
* Description:
* Implements the binary search algorithm
@ -30,7 +30,7 @@
* be inserted into the sorted list if it is not included in the list. The insertion position is
* expressed as index with negative sign, so that the value can be inserted at index (-1 * result).
*/
int binary_search_list(<params>);
int binary_search_list(IntList haystack, criterion_fn criterion, int needle);
/**
* Searches the given needle within the given haystack up the given length using binary search approach.
@ -46,7 +46,7 @@ int binary_search_list(<params>);
* be inserted into the sorted list if it is not included in the list. The insertion position is
* expressed as index with negative sign, so that the value can be inserted at index (-1 * result).
*/
<type> binary_search_list_limited(<params>);
int binary_search_list_limited(IntList haystack, int length, criterion_fn criterion, int needle);
/* ARRAY VARIANT */
@ -62,6 +62,6 @@ int binary_search_list(<params>);
* be inserted into the sorted list if it is not included in the list. The insertion position is
* expressed as index with negative sign, so that the value can be inserted at index (-1 * result).
*/
<type> binary_search_array(<params>);
int binary_search_array(int haystack[], int length, criterion_fn criterion, int needle);
#endif