Why use a dummy node?

Practice this question from Remove Nth Node From End - Two pointers Pattern Practice Quiz, with options and an explanation.

Question

Why use a dummy node?

Option A — Correct answer

It handles removing the head cleanly

Option B

It sorts nodes

Option C

It makes the list circular

Option D

It avoids all pointers

Explanation

It makes removing the head node follow the same logic as other removals.

Remove Nth Node From End - Two pointers Pattern Practice Quiz

All questions · Previous question · Next question

Open on QuizMaker