Name some advantages of Linked List

Technology CommunityCategory: Linked ListsName some advantages of Linked List
VietMX Staff asked 3 years ago

There are some:

  • Linked Lists are Dynamic Data Structure – it can grow and shrink at runtime by allocating and deallocating memory. So there is no need to give initial size of linked list.
  • Insertion and Deletion are simple to implement – Unlike array here we don’t have to shift elements after insertion or deletion of an element. In linked list we just have to update the address present in next pointer of a node.
  • Efficient Memory Allocation/No Memory Wastage – In case of array there is lot of memory wastage, like if we declare an array of size 10 and store only 6 elements in it then space of 4 elements are wasted. There is no such problem in linked list as memory is allocated only when required.