Name an advantage of linked list over array?

Answer Posted / dinesh kumar thakur jalandhar

------> in case of linklist no continuous memeory is
required .but in case of array there is of need continuous
memory block , mean to say if we have enough free memory but
is not in continuous block than we can not use it in case of
array .
but same memery can be used in case of linklist.

Is This Answer Correct ?    6 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does and I oop and sksksk mean?

879


Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?

4484


Why interface is used?

759


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

3520


Why is polymorphism used?

786


Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer

1910


What is the difference between inheritance and polymorphism?

808


What are the 3 pillars of oop?

875


What is encapsulation example?

779


What are the data types in oop?

833


Why do we use encapsulation in oops?

761


Explain the concepts involved in Object Oriented programming.

884


What is inheritance write a program to show use of inheritance?

887


Why is polymorphism needed?

800


Why do we use inheritance?

830