#12_Binary searching
#include <stdio.h> //Binary searching void display ( int arr [] , int size ) { for ( int i = 0 ; i < size ; i ++ ) { printf ( " %d " , arr [i]); } printf ( " \n " ); } int search ( int arr [] , int size , int element ) { //Binary searching int low = 0 , high = size - 1 , mid; while (high != low) { if ( arr [low] == element ) { ret...
Comments
Post a Comment