sentinel value
A special value that can never be real data, used to mark a condition such as "empty", "deleted" or "end".
In more detail
Creating a fresh object() gives a sentinel that nothing else can equal, which is safer than using a value like None or -1 that real data might contain. The course uses one for the tombstone marker. A sentinel node in a linked list applies the same idea to structure.
Related terms
- tombstone — A marker left in place of deleted data to record that something was deleted, so later lookups, reads or copies treat it correctly.
- empty slot — An open-addressed hash table slot that has never held an entry, which tells a lookup it can stop probing.
- 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.
Taught in
- Representing A Graph: Matrix Or Adjacency List — Algorithms & Data Structures for Working Engineers