For 1 -> 2 -> 3 -> 4 -> 5 with n = 2, what node is removed?

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

Question

For 1 -> 2 -> 3 -> 4 -> 5 with n = 2, what node is removed?

Option A

2

Option B

3

Option C — Correct answer

4

Option D

5

Explanation

Node 4 is removed.

Remove Nth Node From End - Two pointers Pattern Practice Quiz

All questions · Previous question · Next question

Open on QuizMaker