|
C Fundamentals
Algorithms · data structures · cryptography · systems — pure C11, zero deps
|
Binary search CLI demo. More...
#include "../sorting/sorts.h"#include "binary_search.h"#include <stdio.h>#include <stdlib.h>#include <string.h>Go to the source code of this file.
Functions | |
| int | main (int argc, char *argv[]) |
| static void | print_array (const int *arr, size_t n) |
Binary search CLI demo.
Usage: bsearch <target> <num1> <num2> ...
The trailing numbers are sorted internally (insertion sort, since the input list is small) before the search runs.
Definition in file algorithms/searching/main.c.
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
Definition at line 27 of file algorithms/searching/main.c.
References binary_search_ints(), BSEARCH_NOT_FOUND, insertion_sort_ints(), and print_array().
|
static |
Definition at line 18 of file algorithms/searching/main.c.
Referenced by main().