Where would you use LinkedList and where an ArrayList?

Solution:

  • LinkedList is used in cases where we have a lot of add, remove and sequential iteration but not a lot of random access ( list.get(n) )
  • ArrayList is used when there is a lot of random access used ( list.get(n) ), but not a lot of add, remove.
0 answers