What is the main feature of oop?
1124
#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.
3719
What are the advantages of polymorphism?
999
What is interface in oop?
1090
Why is it so that we can have virtual constructors but we
cannot have virtual destructors?
4849
write a program using c++ to implement single contiguous
memory mangement techniques.display the content of the main
memory after yhe allocation of jobs and percentage of the
wastage of the main memory
3188
Can we define a class within the interface?
1006
Is html an oop?
1019
Explain the concepts involved in Object Oriented programming.
1173
What is meant by oops concept?
1006
What is a class and object?
1024
Why is oop better than procedural?
1042
Who invented oop?
1081
What is super in oop?
1122
officer say me - i
am offered to a
smoking , then what
can you say
2065