Singly Linked List vs Doubly Linked List

Both structures store a linear sequence of values using nodes and pointers. A singly linked list (SLL) gives each node one link—usually next. A doubly linked list (DLL) adds prev so each node (except ends) knows both neighbors. This page summarizes when each wins.

On this page
  • Structure: one vs two pointers per node
  • Traversal and delete—what gets easier with prev
  • Comparison table and choosing SLL vs DLL

1) Structure

  • SLL: struct Node { T data; struct Node *next; }; — last node’s next is NULL.
  • DLL: add struct Node *prev; — first prev and last next are NULL in a non-circular list.
SLL                         DLL (schematic)
A → B → C → NULL          NULL ← A ↔ B ↔ C → NULL

2) Operations at a glance

Topic SLL DLL (with head + tail)
Memory per node One pointer Two pointers
Insert / delete at front O(1) with head O(1) — fix prev/next
Insert / delete at end O(n) with only head; O(1) with tail O(1) with tail
Delete a node (given only that node) Hard without predecessor—often O(n) scan Easier—prev is local
Backward traversal Not supported from a node alone Follow prev

3) When to prefer which

  • Prefer SLL when memory is tight, you only walk forward, and you rarely delete arbitrary interior nodes without a predecessor pointer.
  • Prefer DLL when you need backward traversal, deque-like behavior at both ends with clear semantics, or frequent removal relative to a known node.

Key takeaway

The DLL’s prev pointer trades extra memory for symmetric navigation and simpler many delete/insert patterns around a known node. Neither structure offers O(1) random access by index.

Previous (DLL): DLL Introduction · Next up (DLL): Insert at Beginning (DLL) · Main linked list tutorial · Introduction to Linked List · Types of Linked List