ProgrammingHard

A list of 6 nodes is split into two halves by a slow and fast pointer. The slow pointer is at the start of the second half. Which node count does the first half have?

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

Correct answer: B. 3

Fast reaches the end after three steps of two nodes, and slow has moved three nodes, so the first half holds three.

More C Programming questions

Exams that ask this topic