Difference Between Array List and Linked List
1. Both array list and Linked list “Implement list Interface”
2. They both maintain the elements insertion order which means while displaying Array
List and Linked List elements the result set would be having the same order in
which the elements got inserted into the List
3. Both are non-synchronized classes
When to use Linked List and when to use Array List?
1) As explained above the insert and remove operations give good performance (O(1)) in Linked List compared to Array List(O(n)). Hence if there is a requirement of frequent addition and deletion in application then Linked List is a best choice.
2) Search (get method) operations are fast in Array list (O(1)) but not in Linked List (O(n)) so If there are less add and remove operations and more search operations requirement, Array List would be your best bet.


No comments:
Post a Comment