CS FundamentalsVery hardGATE CS · TCS NQT Prime · Product Company SDE

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

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

Correct answer: B. 3

V(G) = E - N + 2P = 8 - 7 + 2(1) = 3, using the standard cyclomatic complexity formula.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic