hi, this is raju,iam studying b.tech 2nd year,iam want know
about group1 and group2 details, and we can studying
without going to any instutions? please help me.
1749
Can main method override?
842
class CTest
{
public:
void someMethod()
{
int nCount = 0;
cout << "This is some method --> " << nCount;
}
};
int main()
{
CTest *pctest;
pctest->someMethod();
return 0;
}
It will executes the someMethod() and displays the value
too. how is it possible with our creating memory for the
class . i think iam not creating object for the class.
Thanks in Advance...
Prakash
1996
What are the 3 principles of oop?
840
#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.
3518
Is react oop?
825
What are the 4 main oop principles?
948
#include
#include
#include
#include
void insert(char *items, int count);
int main(void)
{
char s[255];
printf("Enter a string:");
gets(s);
insert(s, strlen(s));
printf("The sorted string is: %s.\n", s);
getch();
return 0;
}
void insert(char *items, int count)
{
register int a, b;
char t;
for(a=1; a < count; ++a)
{
t = items[a];
for(b=a-1; (b >= 0) && (t < items[b]); b--)
items[b+1] = items[b];
items[b+1] = t;
}
}
design an algorithm for Insertion Sort
2381
What is a function in oop?
830
Write a c++ program to display pass and fail for three
student using static member function
3097
How is class defined?
841
What is polymorphism in oops with example?
777
What is abstraction example?
841
What is difference between oop and pop?
884
Can we create object of interface?
851