Category: Searching Algorithms

Linear Search

/*linear search*/ #include #include void main() { int a[50],i,n,num,t; clrscr (); printf (“Enter number of elements in list :”); scanf (“%d”,&n); for (i=0;i

Binary Tree Search

OUTPUT: Enter number of elements in list :5 Enter element 1 :12 Enter element 2 :34 Enter element 3 :45 Enter element 4 :56 Enter element 5 :67 Enter element to be searched :89 Element 89 doesn’t exist. Do u…

Binary Search

/*linear search*/ #include #include #include int start,middle,end; void main() { char q; int a[50],b[50],c[50],i,j,n,t,tmp; clrscr(); printf (“\nEnter number of elements :”); scanf (“%d”,&n); for (i=0;i