Name an advantage of linked list over array?

Answer Posted / satish kondapalli

computer memory is divided into blocks.each work use these
blocks in non-contigious manner.but array elements are
stored in continous memory allocation.this will adversely
affect unuse of the memory blocks.array searches for bigger
blocks it needed,so that many small nlocks of memory is
unused.the main advantage of linkedlist is it can use
non-continuous memory blocks,because of it has the relation
between the nodes,and this is main merit over array.

Is This Answer Correct ?    16 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is an example of genetic polymorphism?

645


What are properties in oop?

597


What is difference between oop and pop?

607


Please send ford technologies placement paper 2 my mail id

1646


What is overloading in oops?

591






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

4232


What is polymorphism what is it for and how is it used?

570


What is encapsulation process?

573


can inline function declare in private part of class?

3651


What is constructor overloading in oop?

597


What is new keyword in oops?

586


what is different between oops and c++

1995


Why do we use oop?

595


How do you achieve runtime polymorphism?

565


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

3240