ProgrammingHard

A list with a sentinel head node is used to simplify insertion. What does the sentinel remove the need for?

  1. A. A need for malloc
  2. B. A special case for inserting or deleting the first real node
  3. C. A need for a tail pointer in every case
  4. D. A need to free the nodes

Correct answer: B. A special case for inserting or deleting the first real node

The sentinel is always present, so every real node has a predecessor, and the head case becomes ordinary code.

More C Programming questions

Exams that ask this topic