# Difference between Linked List and Array

### Memory Allocation

![](https://443921002-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGHUhl6VYqrZm4Re77O%2F-LHUEPUc5-8CrSuOtEzq%2F-LHUHnQIEPpM0puaA_FX%2F1*G43FVT5xJ1n1QDKVNZUxXQ.jpeg?alt=media\&token=e9d6967d-202b-4a7f-b343-e448036c1ce3)

Unlike an array, we don’t need to move all elements past the inserted element. Therefore, you can insert a new node into a linked list in `O(1)` time complexity, which is very efficient.

### Reference

{% embed url="https://medium.com/basecs/whats-a-linked-list-anyway-part-1-d8b7e6508b9d" %}

{% embed url="https://leetcode.com/explore/learn/card/linked-list/209/singly-linked-list/1288/" %}
