2. Draw the corresponding graph and label the nodes as n1, n2, … and edges as e1, e2, …¶
3. Calculate the cyclomatic complexity of the above algorithm¶
we can calculate the cyclomatic complexity according to the law V(G) = e - n + 2 (Marsic, 2012, p.231) where n is the number of nodes and e is the number of edges.
according to the graphs in the previous question, n = 13, e = 18.