What are the differences between ArrayList and LinkedList?
Location: http://www.jguru.com/faq/view.jsp?EID=106663 Created: Jul 20, 2000 Modified: 2000-07-20 07:45:25.631 Author: John Zukowski (http://www.jguru.com/guru/viewbio.jsp?EID=7) Question originally posed by Raymond Lui (http://www.jguru.com/guru/viewbio.jsp?EID=72476 An ArrayList is a List implementation backed by a Java array, similar to the Vector class. As the number of elements in the collection increases, the internal array grows to fit them. If there are lots of growth periods, performance degrades as the old array needs to be copied into the new array. However, random access is very quick as it uses an array index to access. With a LinkedList, the List implementation is backed by a doubly linked list data structure, allowing easy inserts/deletions anywhere in the structure, but really slow random accesses as the access must start at an end to get to the specific position. Which you use really depends on the type of operations you need to support.