Data Structures & AlgorithmsModerateGATE CS · ICPC regional

Problem: What is the chromatic number of the cycle graph C5 (5 vertices in a single cycle)? The chromatic number is the least number of colours that colour adjacent vertices differently.

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

Correct answer: D. 3

An odd cycle needs three colours: two colours force a proper alternation that fails on an odd cycle. Assuming two colours suffice is the classic error.

More Coding Interview Problems questions

Exams that ask this topic