CS FundamentalsHardGATE CS · TCS NQT Prime · Product Company SDE

A control-flow graph has 17 edges, 12 nodes and 2 connected components. Using V(G) = E − N + 2P, what is its cyclomatic complexity?

  1. A. 9
  2. B. 7
  3. C. 13
  4. D. 11

Correct answer: A. 9

V(G) = 17 - 12 + 2(2) = 9; assuming P = 1 instead would wrongly give 7.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic