What should happen when one list becomes empty?
Practice this question from Merge Two Sorted Lists - Dummy node Pattern Practice Quiz, with options and an explanation.
Question
What should happen when one list becomes empty?
Option A — Correct answer
Attach the remaining list
Option B
Discard the remaining list
Option C
Restart from dummy
Option D
Reverse both lists
Explanation
Attach the remaining part of the other list directly.