#include
#include
void main()
{
int a[50],i,n,d,c,root,x;
clrscr();
printf("How many number:");
scanf("%d",&n);
printf("Enter your root value:");
scanf("%d",&root);
a[1]=root;
printf("Enter data");
for(i=0;i
{
printf("Element[%d]=",i+1);
scanf("%d",&d);
if(d
{
x=1;
c=2*x;
while(a[c]!=NULL)
{
if(d
c=2*c;
else
c=2*c+1;
}
a[c]=d;
}
else
{
n=1;
c=2*n+1;
while(a[c]!=NULL)
{
if(d
c=2*c;
else
c=2*c+1;
}
a[c]=d;
}
}
for(i=1;i<=c;i++)
{
printf("%d=%d ",i,a[i]);
}
getch();
}
0 comments:
Post a Comment