liveBook · Manning

Doubly linked list

As explained in Algorithms Every Programmer Should Know

A doubly linked list is a linked list whose nodes contain pointers to both the previous and next nodes.

A doubly linked list stores data in nodes, each with pointers to the previous and next nodes. The links allow traversal in either direction. Compared with arrays, it avoids shifting elements when inserting or deleting, but uses extra memory; finding a position still requires traversal. section 1.4.2

How Algorithms Every Programmer Should Know covers it

How deep it goes
Defines bidirectional links and discusses traversal, memory cost, and insertion before showing a Python append implementation.
Examples
Uses a three-node pointer diagram and Python code that appends nodes and displays the list forward.
What you can do after
Understand when two-way traversal and pointer-based updates suit a task, while accounting for extra memory.
How it connects
Connects linked lists with arrays, hash maps, queues, and Python's deque.

Also explained in

Compare how 4 books explain doubly linked list →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Algorithms Every Programmer Should Know. The section links point to the parts of the book it draws on.