What is the difference between ArrayList and LinkedList

Questions by mscis.suresh

Showing Answers 1 - 9 of 9 Answers

A Linked list is ordered by its index position, like ArrayList, except that the elements are doubly linked to one another. The linkage gives you new methods for adding and deleting from the beginning or the end, which makes it an easy choice for implementing a stack or queue. Keep in mind that a LinkedList may Iterate slowly than an ArrayList but it`s a good choice when you need a fast insertion or deletion.

  Was this answer useful?  Yes

javagek

  • Aug 28th, 2011
 

Arraylist:
-> implements list interface hence can just behave like list.
-> is more faster in situations were we want to iterate through the elements.
-> uses an array as the underlying data structure to implement list functionality.

Linkedlist:
-> implements list, deque and queue interface hence can behave like list, stack or queue.
-> is more faster then arraylist in situations were we want to add and retrieve elements in orderly fashion.
-> uses doubly linked list as its underlying data structure to implement its functionality.

  Was this answer useful?  Yes

sampra

  • Mar 13th, 2012
 

Both are similar, though slightly different in terms of goal and implementation. In a LinkedList, each element is linked to its previous and next element making it easier to delete or insert in the middle of the list. A ArrayList is more as its name subjects used as an array.
Performance is similar, though LinkedList is optimized when inserting elements before the end of the list, where ArrayList is optimized when adding elements at the end.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions