Monday, 26 August 2013

Linked list Vs Array

Linked list and array:
Linked list and array are same to store the collection of data.
But the difference is array only store the same type of Data. Linked List store the different kinds of data using structures.
Structures are used to create a collection of data with different types.


The Disadvantage of using array is we can initially declare the array[100].
It means at compile time it will be allocated for 100 blocks.
But most of the time we use only 20 to 30 blocks of array.
So that the remaining memory spaces are wasted.
For recovering this we need to initialize the array dynamically at runtime.
That is done with the help of malloc() function and Pointers

No comments: