CBSE NET DECEMBER 2013 PAPER III
Given a flow graph with 10 nodes, 13 edges and one connected components, the number of regions and the number of predicate(decision) nodes in the flow graph will be
To solve above problem, first remember these 3 rules to compute the cyclomatic complexity.
1. The number of regions correspond to the cyclomatic complexity.
2. Cyclomatic complexity V(G) for a flow graph G, is defined as,
where E=Number of flow graph edges
N=Number of flow graph nodes
3.Cyclomatic complexity,V(G) for a flow graph G, is defined as,
where P=Number of predicate nodes contained in flow graph G.
Now come to the solution for above problem, given, N=10,E=13
Therefore, No of regions = 5. (According to rule 1.)
According to rule 3, V(G)=P+1
V(G) refers to the cyclomatic complexity which is equal to the no of regions.
So, the number of predicate nodes in the flow graph is 4.
So, the number of regions and the number of predicate nodes in the flow graph will be 5,4
So, Answer is B.