Array and Linked List are two commonly used data structures in programming. They have many similarities but also some key differences which make them more suitable for different tasks. In this article, we will look at the main differences between Array and Linked List to help you decide which is best for your project.
About Difference Between Array And Linked List
Array | Linked List |
---|---|
Indexed, random access | Sequential Access |
Fixed Size Data Structure | Dynamic Size Data Structure |
Insertion/Deletion is costly | Insertion/Deletion is easy |
Memory usage is contiguous | Memory usage is scattered |
Time Complexity for search is O(1) | Time Complexity for search is O(n) |
Data stored in sequence | Data stored non-contiguously |
Supports Random Access | Does not support Random Access |
— by
Leave a Reply