How does hibernate distinguish between transient (i.e. Newly instantiated) and detached objects?
313
Whenever python exists why does all the memory is not de-allocated / freed when python exits?
795
Why waste is considered one of the major environmental issues?
340
Noisy laptop
My Toshiba Laptop, Model: Satellite L355-S7905 is making
from time to time ugly noise like sparks, not to mention
the sound of the fan. What shall I do?
2808
Will subsequent children have heart problems?
844
What is difference between @restcontroller and @controller?
433
Not all reserved words are written in lowercase. TRUE or FALSE?
1188
How variables are stored in memory?
959
Explain the structure of bug life cycle?
937
What is the default replication factor and how will you change it?
489
Tell us which data visualization libraries do you use?
147
#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.
3704
What is the use of function overloading in C?
1106
What are the benefits of linux?
875
What / supported operating system platforms Selenium?
967