全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 Sentinel?

Definition 15.2 University Computer Science — Year 1 · 第 15 章 — Linked Structures: Lists, Stacks and Queues

A sentinel is a cell that holds no element and is always present. In a circular doubly linked list with a sentinel, the sentinel’s successor is the first cell, its predecessor the last, and the empty list is the sentinel pointing to itself both ways.

A circular doubly linked list with a sentinel S, empty and holding 1, 2, 3. Every cell has two neighbours, so insertion and removal never test for an end.
A circular doubly linked list with a sentinel S, empty and holding 1, 2, 3. Every cell has two neighbours, so insertion and removal never test for an end.
在原文中阅读 →