Data Structures & AlgorithmsModerateTCS NQT · graph colouring

Problem: What is the minimum number of colours needed to colour a bipartite graph so that no adjacent vertices share a colour?

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

Correct answer: D. 2

A bipartite graph is 2-colourable by its two sides, and any graph with an edge needs at least 2 colours.

More Coding Interview Problems questions

Exams that ask this topic