sentinel node

A dummy node that sits permanently at the start of a linked list and holds no real data, so the list is never truly empty.

In more detail

With a sentinel, every real node has a predecessor, so insert and delete never need special cases for "the list is empty" or "this is the head". It costs one node of memory. The course's linked-list code shrinks noticeably once the sentinel is added.

Related terms

Taught in

References