Where do u set the default paragraph?
962
Why hashmap is faster than hashset?
978
#include
#include
#include
#include
void insert(struct btreenode **, int);
void inorder(struct btreenode *);
struct btreenode
{
struct btreenode *leftchild;
struct btreenode *rightchild;
int data;
};
main()
{
struct btreenode *bt;
bt=(struct btreenode *)NULL;
int req,i=1,num;
clrscr();
printf("Enter number of nodes");
scanf("%d",&req);
while(i<=req)
{
printf("Enter element");
scanf("%d",&num);
insert(&bt,num);
i++;
}
inorder(bt);
}
void insert(struct btreenode **sr, int num)
{
if(*sr==NULL)
{
*sr=(struct btreenode *)malloc (sizeof(struct btreenode));
(*sr)->leftchild=(struct btreenode *)NULL;
(*sr)->rightchild=(struct btreenode *)NULL;
(*sr)->data=num;
return;
}
else
{
if(num < (*sr)->data)
insert(&(*sr)->leftchild,num);
else
insert(&(*sr)->rightchild,num);
}
return;
}
void inorder(struct btreenode *sr)
{
if(sr!=(struct btreenode *)NULL)
{
inorder(sr->leftchild);
printf("\n %d",sr->data);
inorder(sr->rightchild);
}
else
return;
}
please Modify the given program and add two methods for post
order and pre order traversals.
3740
Why we use asp.net for website development?
887
How do I convert wordpress to html?
182
What happens if recursive calls get out of control?
1060
What do you mean by xml cache?
956
how to estimate material requirement for an area of house in
square feet?
2318
How many times finalize method will be invoked? Who invokes finalize() method in java?
1005
What are anonymous methods and lambda expression?
820
what do you mean by an input subfile, what are the keywords required?
1240
What is routing protocols purposes?
940
Does mongodb need a lot of ram?
5
What is the query and subquery?
1060
What is Basel I?
1219