C Fundamentals
Algorithms · data structures · cryptography · systems — pure C11, zero deps
Loading...
Searching...
No Matches
main.c File Reference

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)
 

Detailed Description

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.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

◆ print_array()

static void print_array ( const int *  arr,
size_t  n 
)
static

Definition at line 18 of file algorithms/searching/main.c.

Referenced by main().