Q1) Draw the flowchart of the above algorithm
Q2) . Draw the corresponding graph and label the nodes as n1, n2, … and edges as e1,
e2,…
Q3) Calculate the cyclomatic complexity of the above algorithm
By using the formula, Cyclomatic complexity => E – N + 2*P
Edges (E) = 22
Nodes (N) = 19
Exit Point (P) = 1
22 – 19 + (2 * 1)
3+2
5 (no. of closed regions)
VLI (G) = no. of closed regions + 1
Hence, VLI (G) = 5 + 1 = 6