Why is oop useful?
1109
Why oops is important?
1125
Which type does string inherit from?
1107
Explain virtual inheritance?
1205
write a program to find 2^n+1 ?
2072
What does oop mean in snapchat?
1239
explain sub-type and sub class?
atleast u have differ it into 4 points?
2317
What are the 3 pillars of oop?
1193
2. Give the different notations for the class.\
2166
#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.
3764
What language is oop?
1012
Are polymorphisms mutations?
1164
What is the use of oops?
1066
How do you achieve polymorphism?
1081
What are objects in oop?
1109