Summary

Doubly linked list

OperationMethodPerformance
get(i)list traversal- , first element/last element
- , other elements
search(v)linear search- , first element/last element
- , not found
insert(i, v)traverse the list and insert the node- , insert at head, shift head pointer
- , insert into empty list, need to set the tail pointer
- , insert in between
- , insert after tail, shift tail pointer
remove(i)traverse the list and remove the node- , remove at head/remove at tail
- , remove in between
Strengths
  • fast insertion and extraction at the head and tail

Limitations

  • indexing requires traversal

Concept

Data structure

  • series of nodes
  • pointer to next and previous node
  • non-contiguous
a1a2...anheadtail
java
class Node {
	Node previous;
	Object data;
	Node next;
}