ProgrammingVery hard

Merging two sorted singly linked lists of length 3 each with the standard merge, what is the largest number of key comparisons needed?

  1. A. 5
  2. B. 6
  3. C. 3
  4. D. 4

Correct answer: A. 5

Each comparison outputs one node, and the last node of the first list ends the merge without a comparison. So at most 3 + 3 - 1 = 5 comparisons.

More C Programming questions

Exams that ask this topic