Comment on c++ standard exceptions?
1136
What is difference between array and vector in c++?
1080
What is the error in the code below and how should it be corrected?
826
#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
Which sort does c++ use?
1086
Differentiate between a copy constructor and an overloaded assignment operator.
1143
write a code for this:trailer recordId contains a value
other than 99, then the file must error with the
reason ‘Invalid RECORD_ID’(User Defined Exception).
2210
What are the different scope C++ provide ?
1047
Explain linked list using c++ with an example?
1140
Arrange Doubly linked list in the ascending order of its
integral value and replace integer 5 with 7?
4182
How can we read/write Structures from/to data files?
1191
What is the use of dot in c++?
1134
Write a C++ program to print strings in reverse order.
997
What is the benefit of oop?
1109
Can I create my own functions in c++?
1146