Data Structures & AlgorithmsHardTCS Digital · Infosys pattern

A connected undirected graph has vertex degrees A: 3, B: 4, C: 2, D: 3, E: 2. Does it have an Euler path (using every edge exactly once), and if so, where must it start?

  1. A. Yes, at any vertex
  2. B. No, B has degree 4
  3. C. Yes, at A or D
  4. D. No, there are odd-degree vertices

Correct answer: C. Yes, at A or D

A connected graph has an Euler path iff it has 0 or 2 odd-degree vertices. Here exactly A and D are odd, so an Euler path exists and must start at one of them and end at the other. With 0 odd vertices you could start anywhere (Euler circuit); even degrees like B's 4 never block it.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic