...
UGC NET CS 2008-june-Paper-2
December 31, 2024
Hashing
December 31, 2024
UGC NET CS 2008-june-Paper-2
December 31, 2024
Hashing
December 31, 2024

Graphs-and-Tree

Question 7
A flow graph F with entry node (1) and exit node (11) is shown below:

What is the cyclomatic complexity of flowgraph F

A
2
B
3
C
4
D
5
Question 7 Explanation: 
To find cyclomatic complexity we have 3 formulas
1. The number of regions(R) corresponds to the cyclomatic complexity.
Total number of regions(R) are 4.
2. V(G),Flow graph is defined as V(G)=E-N+2 where E is the number of flow graph edges, and N is the number of flow graph nodes.
Predicates are 3+1=4
3. V(G),Flow graph is defined as V(G)=P+1 where p is the number of predicate nodes contained in the flow graph G.
Edges(E)-Nodes(N)+2
= 11-9+2
= 2+2
= 4
Correct Answer: C
Question 7 Explanation: 
To find cyclomatic complexity we have 3 formulas
1. The number of regions(R) corresponds to the cyclomatic complexity.
Total number of regions(R) are 4.
2. V(G),Flow graph is defined as V(G)=E-N+2 where E is the number of flow graph edges, and N is the number of flow graph nodes.
Predicates are 3+1=4
3. V(G),Flow graph is defined as V(G)=P+1 where p is the number of predicate nodes contained in the flow graph G.
Edges(E)-Nodes(N)+2
= 11-9+2
= 2+2
= 4
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x