CS FundamentalsHardCognizant · Capgemini pattern
A program's control flow graph has two separate connected components (for example, main and one called function drawn separately), with 14 edges and 12 nodes in total. What is its cyclomatic complexity?
- A. 8
- B. 4
- C. 2
- D. 6
Correct answer: D. 6
V(G) = E − N + 2P = 14 − 12 + 2(2) = 6. Assuming a single component (P = 1) gives 4.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- How many of the following statements about cyclomatic complexity are correct? 1. It equals the number of linearly independent paths…
- A function has three integer inputs. How many test cases does worst-case boundary value analysis (every combination of min, min+, nom…
- main has commits A–B–C. Branch feature was created from B and has commits D–E. On feature you run git rebase main. How many of these…
- How many of the following statements about git reset are correct? 1. git reset --mixed HEAD~1 removes the last commit and leaves its…
- On main you run git merge --squash feature and then git commit. Afterwards you try git branch -d feature. What happens?
- You checked out an old commit by its hash, made two commits, then ran git checkout main. What happened to those two commits?