CS FundamentalsHardAccenture · Tech Mahindra pattern

A control flow graph has 27 edges and 19 nodes, split across 2 separate connected components. What is its cyclomatic complexity?

  1. A. 14
  2. B. 12
  3. C. 10
  4. D. 8

Correct answer: B. 12

V(G) = E − N + 2P = 27 − 19 + 2(2) = 12. Assuming a single component (P = 1) wrongly gives 10.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic