Can you explain the key differences between Array and Linked List? Typed preference.
Following are the key differences between Array and Linked List:
1.In Array there is a contiguous memory allocation whereas In Linked list there is non-contiguous memory allocation.
2.In array element can be accessed randomly but it is not possible in linked list, every time sequential access is required.
3. Size of array should be declared at the time of declaration but it is not in case of linked list, memory is allocated dynamically.
4.Array takes less memory as compared to linked list because in linked list extra pointer are also used with each node.
5.In array memory access is fast but it is slow in case of linked list.
Get Answers For Free
Most questions answered within 1 hours.