CS FundamentalsVery hardGATE CS · TCS NQT

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

  1. A. 6
  2. B. 8
  3. C. 10
  4. D. 4

Correct answer: B. 8

V(G) = 20 - 16 + 2 x 2 = 8; using P = 1 would wrongly give 6.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic