What is polymorphism and example?
1099
What is the difference between encapsulation and polymorphism?
1156
What is difference between pop and oop?
1237
when to use 'mutable' keyword and when to use 'const cast'
in c++
2218
Write a program to reverse a string using recursive function?
2412
What are classes oop?
1091
Please send ford technologies placement paper 2 my mail id
2149
#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.
3830
What is an interface in oop?
1091
What is the point of oop?
1261
What is the purpose of enum?
1058
What are the important components of cohesion?
1078
What is ambiguity in inheritance?
1172
What is polymorphism what are the different types of polymorphism?
1067
What is cohesion in oop?
1112