Linked List - ashishranjandev/interview-wiki GitHub Wiki

Difference with Arrays

  • Dynamic Size
  • Ease of Insertion/Deletion
  • Random access is not allowed. We have to access elements sequentially starting from the first node.
    We cannot do binary Search directly. (We can do using skip lists but complexity would be O(n)).
  • Extra memory space for a pointer is required.
  • Not cache friendly. Since array elements are contiguous locations, there is locality of reference which is not there in case of linked lists.
⚠️ **GitHub.com Fallback** ⚠️