LinkedList
implements List
-
Underlying Data Structure: Doubly Linked List
-
Duplicates: Allowed
-
Insertion Order: Preserved
-
null insertion: Allowed
-
Best choice for: Insetion/deletion in middle
-
Worst choice for: Random Access
-
Constructors:
LinkedList l = new LinkedList()
LinkedList l = new LinkedList(Collection C)
-
Default initial capacity: 0
-
Load factor/fill ratio:
-
New Capacity:
-
References not stored contiguously → no shift operations required while adding/removing elements
-
Usually used for implementing Stack and Queue.
Some specific methods for this purpose:
void addFirst(Object O)
void addLast(Object O)
Object getFirst()
Object getLast()
Object removeFirst()
Object removeLast()
Backlinks