Data Structures & AlgorithmsModerateTCS NQT · Infosys

Problem: An undirected graph on 7 vertices (0–6) has degrees 0:3, 1:2, 2:4, 3:1, 4:2, 5:3, 6:1. How many vertices have odd degree? (Such a graph has an Eulerian circuit only when this number is 0.)

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

Correct answer: A. 4

By the handshake lemma the number of odd-degree vertices is even, and an Eulerian circuit requires zero of them. The count itself is the quantity asked here, not a yes/no decision.

More Coding Interview Problems questions

Exams that ask this topic