what is the need of abstraction? what is abstraction?what
is the abstraction for stack?

Answer Posted / mms zubeir

As I answered one of the questions here, the abstraction is
nothing but declaration of a concept in software terms
which does not exist in real-world.

For example, mango, drumstick, brinjal, potato are all
vegetables. But "Vegetable" is just a concept and it has no
real-world existance.

To represent these kind of concept in software terms, we
need abstration.

On the other hand, the mango, brinjal, ... are all have
concrete implementations since they have certain properties
and can do some operations on them in the real world.

I couldn't get the third question "abstraction for stack",
but I try to answer with what I understood.

Normally, stack's operations include push, pop, top, size,
empty e.t.c. If we define an interface with these, it ll be
an abstraction for stack. Let me know if it doesn't answer
your question.

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the real life example of polymorphism?

599


i=20;k=0; for(j=1;k-i;k+=j<10?4:3) { cout<

1409


what are the ways in which a constructors can be called?

1570


What is advantage of inheritance?

677


What is polymorphism used for?

561






What are properties in oop?

592


What is object in oop?

669


#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.

3235


What is polymorphism what are the different types of polymorphism?

553


What is a function in oop?

623


What is property in oops?

555


What is class and object in oops?

604


What is oops and why we use oops?

565


Why polymorphism is used in oops?

575


What is overloading in oop?

566