Copyright © 2017, edureka and/or its affiliates. All rights reserved.
What is a LinkedList?
What is an ArrayList?
Similarities between LinkedList and ArrayList
LinkedList vs ArrayList
www.edureka.co/java-j2ee-soa-training
www.edureka.co/java-j2ee-soa-training
LinkedList
A linked list is a linear data structure which is constituted by a chain of nodes in
which each node contains a value and a pointer to the next node in the chain.
LinkedList
A linked list is a linear data structure which is constituted by a chain of nodes in
which each node contains a value and a pointer to the next node in the chain.
www.edureka.co/java-j2ee-soa-training
LinkedList Broken list
www.edureka.co/java-j2ee-soa-training
LinkedList features
Implements Queue and
Deque interfaces01
Maintains insertion order02
It is not synchronized03
www.edureka.co/java-j2ee-soa-training
www.edureka.co/java-j2ee-soa-training
ArrayList
ArrayList is the implementation of
List Interface where the elements
can be dynamically added or
removed from the list.
ArrayList
ArrayList is the implementation of
List Interface where the elements
can be dynamically added or
removed from the list.
www.edureka.co/java-j2ee-soa-training
Similarities between LinkedList & ArrayList
www.edureka.co/java-j2ee-soa-training
Similarities
between
LinkedList
& ArrayList
They are the implementations of the List interface.
They maintain the insertion order of the elements.
Their classes are non-synchronized.
Iterator & ListIterator returned by these classes are fail-fast
www.edureka.co/java-j2ee-soa-training
www.edureka.co/java-j2ee-soa-training
PARAMETERS
TO COMPARE
Operation
Implementation
Process
Memory
1
2
3
4
www.edureka.co/java-j2ee-soa-training
ARRAYLIST
Python
LINKEDLIST
Insertion, deletion and removal operations are faster in LinkedList because no need for resize as it is in ArrayList.
Operation
Insertion, addition, and removal
operations are quite faster
Comparatively the operations
are slow here
LinkedList ArrayList
www.edureka.co/java-j2ee-soa-training
ARRAYLIST
Python
LINKEDLIST
LinkedList is based on doubly linked list implementation whereas ArrayList is based on the concept of a dynamically
resizable array,
Implementation
Follows Doubly linked list
implementation
Follows the concept of
dynamically resizable array
LinkedList ArrayList
www.edureka.co/java-j2ee-soa-training
ARRAYLIST
Python
LINKEDLIST
A LinkedList class can be used as a list and a queue because it implements List and Deque interfaces whereas ArrayList can
only implement Lists.
Process
A LinkedList class can be a list and a queue
because it implements List and Deque interfaces
An ArrayList class can be a list because it
implements only Lists
LinkedList ArrayList
www.edureka.co/java-j2ee-soa-training
ARRAYLIST
Python
LINKEDLIST
A LinkedList consumes more memory than an ArrayList because every node in a LinkedListstores two references, whereas
ArrayList holds only data and its index
Memory
Memory consumption in LinkedList is high Less compared to LinkedList
LinkedList ArrayList
www.edureka.co/java-j2ee-soa-training
www.edureka.co/java-j2ee-soa-training

LinkedList vs ArrayList in Java | Edureka