انتقل إلى المحتوى

مورد · دليل أو مقال

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 هذه النظرة العامة وراجعوها اعتمادًا على المستودع المصدر. وهي ليست نصًا من المورد نفسه.

مناسب لـ
لا يحدد المصدر مستوى
الشكل
مرجع

ما الذي يغطيه

  • التعريف، بما في ذلك العقد الحارسة (sentinel) والصيغة الدائرية
  • شيفرة زائفة للإضافة في الذيل وللحذف حسب القيمة، مع الحالات الحدية للرأس والذيل
  • شيفرة زائفة للاجتياز العكسي بدءًا من الذيل
  • جدول التعقيد: الوصول والبحث O(n)، والإدراج O(1)، والحذف O(n)، والمساحة O(n)

كيف تستخدمه

نصيحة دراسية من PrepKit، وليست ادعاءً من المصدر.

نفّذ الشيفرة الزائفة لعملية Remove واختبر أربع حالات: قائمة فارغة، وحذف العقدة الوحيدة، وحذف الذيل، وحذف عقدة في الوسط.

النطاق والقيود

شيفرة زائفة فقط في الصفحة، دون تمارين أو مسائل بأسلوب المقابلات. ورقم الحذف يفترض البحث حسب القيمة أولًا.

الوصول والشكل

ملف README على GitHub في المستودع trekhleb/javascript-algorithms (MIT)؛ مع روابط لترجمات بسبع لغات أخرى. باللغة الإنجليزية، مجاني.

راجعه PrepKit في 02‏/10‏/2026. إيداع مصدر المورد: 85293e3e2b88

أدلة هذه النظرة العامة
  • src/data-structures/doubly-linked-list/README.md

صفحات تتضمن هذا العنصر

اشترك في النشرة البريدية من PrepKit

اختيارية. لا تحتاج إليها لاستخدام PrepKit.

كيف نتعامل مع بريدك الإلكتروني