Array
|
Linked List
|
Size of the array is fixed |
Dynamic size |
Less memory required |
More memory required |
Stored in contiguous Memory Locations |
Stored in non-contiguous Memory Locations |
Memory Should be allocated at Compile-Time |
Memory is allocated at Run-Time |
Elements can be modified easily by identifying the index value |
Complex process for modifying the node |
Elements cannot be added, deleted once it is declared |
Nodes in the linked list can be added and deleted from the list |
Directly access any element in an array |
We can't directly access any element but we need to traverse over the entire list |
Shuffling the elements of an array requires more time |
Shuffling the elements of a linked list requires less time |
Access any element in an array take less time |
Access any element in an array take more time |
Arrays can hold only one value at a time |
It can hold more than one at a time |
![Data Structures - Array Vs Linked List array in c](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3AR1Rt_VMsMUSVJ3UJVQNuLFR2l5GUtushAvJILXUSN6ADyBin_1fbfpOOFK0fMApGge9DYd1CFmTeFFyj7AMQrb5Q8y-kwQtt51QlFCZmDPLODsJajcqfy_cTdXh26QsqH72ic1j_Aak/s200-rw/Untitled+Diagram+%25283%2529.jpg) |
|
Post a Comment