Array vs Linked List

PHOTO EMBED

Mon May 31 2021 06:12:13 GMT+0000 (UTC)

Saved by @jatin_sachdeva

So Linked list provides the following two advantages over arrays 
1) Dynamic size 
2) Ease of insertion/deletion 

Linked lists have following drawbacks: 
1) Random access is not allowed. We have to access elements sequentially starting from the first node. So we cannot do a binary search with linked lists. 
2) Extra memory space for a pointer is required with each element of the list. 
3) Arrays have better cache locality that can make a pretty big difference in performance.
content_copyCOPY