Resource · Guide or article
Doubly Linked List
Explains lists whose nodes link both backward and forward, and why the extra link makes some removals simpler than in a singly linked list.
Reviewed
Open the original: Doubly Linked List (opens the original site in a new tab)Practice this topicOpens the practice interviewer in Technical / coding mode; choose a question there.
Add to a roadmap
Keep this resource with a roadmap you follow. It appears as your own extra resource; the roadmap's steps don't change and it doesn't count toward your tracked steps.
Source content: English
Read this in other languages: Русский, 简体中文, 日本語, Português, 한국어, Español, Українська In computer science, a doubly linked list is a linked data structure that consists of a set of sequentially linked records called nodes. Each node contains two fields, called links, that are references to the previous and to the next node in the sequence of nodes. The beginning and ending nodes' previous and next links, respectively, point to some kind of terminator, typically a sentinel node or null, to facilitate the traversal of the list. If there is only one sentinel node, then the list is circularly linked via the sentinel node. It can be conceptualized as two singly linked lists formed from the same data items, but in opposite sequential orders. The two node links allow traversal of the list in either direction. While adding or removing a node in a doubly linked list requires changing more links than the same operations on a singly linked list, the operations are simpler and potentially more efficient (for nodes other than first nodes) because there is no need to keep track of the previous node during traversal or no need to traverse the list to find the previous node, so that its link can…
PrepKit overview
PrepKit editors wrote and reviewed this overview from the source repository. It is not text from the resource itself.
- Suited to
- The source does not state a level
- Format
- Reference
What it covers
- Definition, including sentinel nodes and the circular variant
- Pseudocode for appending at the tail and for removing by value, with head and tail edge cases
- Pseudocode for reverse traversal from the tail
- Complexity table: access and search O(n), insertion O(1), deletion O(n), space O(n)
How to use it
PrepKit study advice, not a claim made by the source.
Implement the Remove pseudocode and test four cases: an empty list, removing the only node, removing the tail, and removing a middle node.
Scope and limitations
Pseudocode only on the page, with no exercises or interview-style problems. The deletion figure assumes a search by value first.
Access and format
README on GitHub in trekhleb/javascript-algorithms (MIT); translations in seven other languages are linked. English, free.
Reviewed by PrepKit on Oct 2, 2026. Listing source commit: 85293e3e2b88
Evidence behind this overview
- src/data-structures/doubly-linked-list/README.md
Pages that include this
Get the PrepKit newsletter
Optional. You don't need it to use PrepKit.