Data Structures & AlgorithmsModerateHCL · Tech Mahindra pattern

An undirected graph has 12 vertices and the sum of the degrees of all vertices is 40. How many edges does it have?

  1. A. 80
  2. B. 40
  3. C. 20
  4. D. 28

Correct answer: C. 20

Each edge adds 1 to the degree of both its endpoints, so the sum of degrees = 2E, giving E = 40/2 = 20.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic