Data Structures & AlgorithmsHardTCS NQT · Accenture

Two sorted linked lists are [1, 5, 9, 12] and [2, 3, 8]. They are merged into one sorted list. What is the 5th value of the merged list (1-based)?

  1. A. 9
  2. B. 10
  3. C. 12
  4. D. 8

Correct answer: D. 8

The merged list is 1, 2, 3, 5, 8, 9, 12, so the 5th value is 8. Taking the 5th value of the first list gives a different answer.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic