From a psychological view, complexity varies in terms of nodes, as different analyst interprets nodes differently (some consider two sequences as one node while other treat them separately) but the underlying principle remains the same.
Using the P+1 formulae will tell you whether you're right or wrong if you're calculating from a given piece of code. P = Predicate. A predicate is where you have branches in your code. Eg.
From your code, I can see three predicates; Therefore 3P + 1 = 4 Regions and your answer shows only three regions.
You might want to look at it again.
Life is not perfect, but the way you live it can make it perfectly wonderful
roses are red, violets are blue. Some poems rhyme and some are a tiny ad:
how do I do my own kindle-like thing - without amazon