CS FundamentalsHardHCL · Tech Mahindra pattern

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

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

Correct answer: A. 12

V(G) = E − N + 2P = 24 − 16 + 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