/* Implementation of recursive binary search and sequential search */
#include
#include
#include
#include
#define max 20 int pos;
int binsearch(int,int[],int,int,int);
int linsearch(int,int[],int);
void main()
{
int ch=1;
double t;
int n,i,a[max],k,op,low,high,pos;
clock_t begin,end;
clrscr();
while(ch)
{
printf("\n.....MENU.....\n 1.Binary Search\n 2.Linear Search\n 3.Exit\n");
printf("\nEnter your choice\n");
scanf("%d",&op);
switch(op)
{
case 1:printf("\nEnter the number of elements \n");
scanf("%d",&n);
printf("\nEnter the elements of an array in order\n");
for(i=0;ihigh)
return -1;
if(k==a[mid])
return(mid);
else
if(k