リソース · ガイド・記事
Doubly Linked List
ノードが前後の両方向にリンクするリストと、その追加のリンクによって単方向連結リストより一部の削除が簡単になる理由を説明しています。
確認日
元のサイトを開く: Doubly Linked List (元のサイトを新しいタブで開きます)このトピックを練習技術 / コーディング モードで練習用面接官を開きます。問題はそこで選びます。
ロードマップに追加
取り組んでいるロードマップにこのリソースを追加できます。自分用の追加リソースとして表示され、ロードマップの手順は変わらず、記録した手順数にも数えられません。
出典コンテンツの言語:英語
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 の概要
この概要は PrepKit 編集部がソースリポジトリをもとに執筆・確認したもので、リソース本文の引用ではありません。
- 対象
- ソースにレベルの記載はありません
- 形式
- リファレンス
扱っている内容
- 番兵ノードと循環型の変形を含む定義
- 末尾への追加と値による削除の疑似コードで、先頭と末尾の境界ケースも扱っています
- 末尾からの逆方向の走査の疑似コード
- 計算量の表:アクセスと探索 O(n)、挿入 O(1)、削除 O(n)、空間 O(n)
使い方
PrepKit の学習アドバイスであり、ソースの主張ではありません。
Remove の疑似コードを実装し、空のリスト、唯一のノードの削除、末尾の削除、中間のノードの削除という4つのケースでテストしてください。
範囲と制約
ページにあるのは疑似コードだけで、演習や面接形式の問題はありません。削除の計算量は、先に値で探索することを前提としています。
利用方法と形式
GitHub の trekhleb/javascript-algorithms(MIT)にある README で、他の7言語の翻訳へのリンクがあります。英語で、無料です。
PrepKit が 2026/10/02 に確認しました。 リソースの出典のコミット: 85293e3e2b88
この概要の根拠
- src/data-structures/doubly-linked-list/README.md
この項目を掲載しているページ
PrepKit ニュースレターを受け取る
任意です。PrepKit の利用には必要ありません。