IMPLEMENTATION OF RECURSIVE BINARY SEARCH TREE
PROGRAM:
#include
#include
#define size 10
int n;
void main()
{
int a[size],flag,i,key,low,high;
int binsearch(int a[size],int key,int low,int high);
clrscr();
printf("\n How many are there in array");
scanf("%d",&n);
printf("\n Enter the Element");
for(i=0;i
printf("\n Enter the Element which is to be searched");
scanf("%d",&key);
low=0;
high=n-1;
flag=binsearch(a,key,low,high);
printf("\n Element a[%d] location",flag);
getch();
}
int binsearch(int a[size],int key,int low,int high)
{
int m;
m=(low+high)/2;
if(key==a[m])
return m;
else if(keybinsearch(a,key,low,m-1);
else
binsearch(a,key,m+1,high);
}
OUTPUT:
How many are there in array 5
Enter the Element
1
2
3
4
5
Enter the Element which is to be searched 3
Element a [2] location
CIET college Programs,LAB Programs for Engineering Students,DAA LAB Programs,DSA LAB Programs,Remoboys,karthik,Remokn,Student3k,programs source code,Design Analysis And Algorithms LAB Programs,Data Structures and Algorithms LAB Programs,LAB Codings,Coimbatore Institute of Engineering and Technology ( CIET )
Wednesday, September 22, 2010
IMPLEMENTATION OF RECURSIVE BINARY SEARCH TREE PROGRAM
9:47 AM
Karthikh Venkat
Popular Posts( Last 7 Days )
-
எதுக்குடா இந்த மானங்கெட்ட பிழைப்பு இந்த விஜய் பிச்சகாரனுக்கு......?????? இந்த பிச்ச முத்து , மக்களுக்கு பசுமாடு குடுக்கராராமா ....? யாரு...
-
Registering your Domain name in BigRock is a great idea. BigRock.com is providing lots and lots of great facilities. And Domai...
-
wwe wallpapers,wwe stills, wwe posters,wwe latest picture photo posters collections, batista latest pictures wallpapers posters news recent
-
Nadunisi Naaygal download,Nadunisi Naaygal free Download,Nadunisi Naaygal TC Rip,Nadunisi Naaygal 700 MB,Nadunisi Naaygal free Download,Na...
-
Asus G73 Gaming Rog nVidia GeForce GTX 3D graphics with 460 offers 1.5 GB of GDDR5 memory and supports NVIDIA 3D Vision, and comes with N...
-
Mr Perfect Prabhas New Movie Stills Prabhas New Movie Mr Perfect Latest Stills, Mr Perfect movie photo gallery, mr perfect new stills. prab...