1 Qs · 2015 · 2 marks · 0.3 marks/paperStandard yield
In GATE CS, Control Flow and Cyclomatic Complexity questions evaluate the student's ability to compute McCabe's Cyclomatic Complexity across multiple representations (C code snippe… Guide
Topic guide
In GATE CS, Control Flow and Cyclomatic Complexity questions evaluate the student's ability to compute McCabe's Cyclomatic Complexity across multiple representations (C code snippets, explicit Control Flow Graphs, and composite/sequential modules). The core focus is on applying graph-theoretic and predicate-based definitions of cyclomatic complexity to measure code complexity.
Multi-Representation Cyclomatic Complexity Calculation
rare · MCQ · 2 marks · 2015
Given a mix of code snippets, a control flow graph diagram, and a composite module connected sequentially, determine the respective cyclomatic complexities.
McCabe's Cyclomatic Complexity (Graph formula)
Used when the number of edges , nodes , and connected components (usually for a single program) of a Control Flow Graph are known.
McCabe's Cyclomatic Complexity (Predicate formula)
Used directly on source code where is the count of simple predicate/decision nodes (e.g., if, while, for).
McCabe's Cyclomatic Complexity (Planar Region formula)
Used when counting bounded enclosed regions plus one unbounded (external) region in a planar control flow graph.
Sequential Composition of Single-Entry Single-Exit (SESE) Modules
Used when two independent modules and are concatenated sequentially with a single transition edge from exit of to entry of .
Appears as a 2-mark comprehensive question testing cyclomatic complexity across code, graph representation, and serial composition of modules.
2015
Medium difficulty arises from combining multiple steps: deriving from textual source code, reading a visual graph diagram to count and , and applying composition rules for connected modules without making arithmetic or boundary errors.