ArrayList Vs LinkedList

Sourabhh Sethii
1 min readMar 26, 2019

--

Collections

ArrayList V/S LinkedList

ArrayList and LinkedList both implements List interface.

ArrayList’s search operation is faster than Linked List’s search operation.

ArrayList gives the performance of o(1) while LinkedList performance is o(n) beacuse ArrayList maintains index based system for its elements as it uses array data structure which makes it faster for searching an element in the list.

LinkedList implements DLL (Doubly Linked Link-list)which requires the traversal through all the elements for searching an element.

Linked List’s insertion and deletion is faster than ArrayList’s insertion and deletion.

Insertion and deletion operation gives o(1) performance while ArrayList gives variable performance: o(n) in worst case (while removing first element) and o(1) in best case (While removing last element).

Usage

If there is a requirement of frequent addition and deletion in application then LinkedList is a best choice.

If there are less add and remove operations and more search operations requirement, ArrayList would be one’s best fit.

--

--

Sourabhh Sethii

I am an author of Building Digital Experience Platform and I am passionate about emerging technologies. https://sourabhhsethii.com/