What are real world examples of when Linked Lists should be used?

Linked Lists offer several advantages over comparable data structures such as static or dynamically expanding arrays.

  1. LinkedLists does not require contiguous blocks of memory and therefore can help reduce memory fragmentation
  2. LinkedLists support efficient removal of elements (dynamic arrays usually force a shift in all of the elements).
  3. LinkedLists support efficient addition of elements (dynamic arrays can cause a re-allocation + copy, if a particular add exceeds the current capacity)

Any place where these advantages would be significantly valuable to a program (and the disadvantages of a LinkedList were negligible) would be a place to use a LinkedList.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)