Singly, Doubly and Circularly Linked Lists Compared

TIME : 2016-01-07
Singly, Doubly and Circularly Linked Lists Compared

The differences come down to how many pointers each node carries and where they point. A linked list is a chain of nodes, each holding some data plus one or more pointers that tie it to its neighbours.

Singly linked: one pointer per node, aimed at the next node. You can only travel forwards, hopping from node to node until you reach the end.

Doubly linked: two pointers per node, one to the next and one to the previous. That lets you move in either direction, which is why doubly linked lists are the choice when you need to remove or reorder nodes mid-list.

Circularly linked: not defined by pointer count but by shape — the last node points back to the first, forming a loop with no end. A non-circular list simply stops when a node's pointer runs out, and you know you are done.

Some implementations use several pointers per node for more complex traversal patterns, but those three cover the great majority of real use.