Summary
Doubly linked list
- implements list ADT
Operation | Method | Performance |
---|---|---|
get(i) | list traversal | - - |
search(v) | linear search | - - |
insert(i, v) | traverse the list and insert the node | - - - - |
remove(i) | traverse the list and remove the node | - - |
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
java
class Node {
Node previous;
Object data;
Node next;
}