Protected: Harman Connected Services

This content is password protected. To view it please enter your password below:

Advertisements

LinkedList

LinkedList is a collection class which extends AbstractList and implements List interface.

  1. LinkedList underlying data structure is doubly Linkedlist.
  2. It doesn’t implements Random access interface so we can’t access the elements randomly.
  3. It is not synchronized. If we want to use LinkedList with multi threading then we need to synchronized explicitly usingĀ  Collections.synchronizedList(List l).
  4. Accessing elements with LinkedList is heavy process because if we want to access a element it needs to traverse full list if the element in the last position.
  5. Adding and removing elements is lightweight process in LinkedList, because it just modify the address of a node.
  6. LinkedList requires more memory than ArrayList because each node holds previous element address, data and next element address.