GATE Computer ScienceEasyGATE CS (PYQ pattern)

Non-negative numbers are stored as singly linked lists of digits with the least significant digit first. A = 9 -> 9 -> 8 -> 5 (the number 5899) and B = 7 -> 2 -> 9 (the number 927) are added digit by digit with a carry. What is the resulting list?

  1. A. 6 -> 2 -> 8 -> 6
  2. B. 6 -> 8 -> 2 -> 6
  3. C. 4 -> 1 -> 7 -> 0 -> 1
  4. D. 6 -> 1 -> 7 -> 6

Correct answer: A. 6 -> 2 -> 8 -> 6

5899 + 927 = 6826, stored least significant digit first: 6 -> 2 -> 8 -> 6.

More Programming and Data Structures (GATE) questions

Exams that ask this topic