AP Computer Science - tricks for doing MC quickly?

<p>Taking the AP CompSci exam really soon, and still struggling with finishing the MC on time. It's really just the recursion problems and nested loops that get me (the latter because I cannot count very well). With recursion problems, my technique is to work through the problem step by step. For example, </p>

<p>public int r(int n){
if(n>0)
return n + r(n-1);
}</p>

<p>I'd do r(4) = 4 + r(3), r(3) = 3 + r(2), and so on, and then substitute back. (Well, for a problem this simple I'd probably recognize what it was, but this is just to illustrate my technique.) This works for the most part, but I am wondering if there is any quicker way to do these problems? Doing every step of the recursion really eats up my time. </p>

<p>For loops, and nested ones especially - I have a lot of trouble figuring out how many times each one iterates. I always get confused with < and <= ... If someone could explain to me how to figure it out very quickly, it would be much appreciated. </p>

<p>If you have any other tips and tricks pertaining to other AP Comp Sci topics, please share!</p>

<p>i do every step in a recursion too, but I do it usually the fastest out of any other problem and i use the same method as you</p>

<p>for the nested for loops, the best way is to just make a table, keeping track of all the variables, do some in barron and you really get the hang of it</p>

<p>for nested loops, pay a lot of attention to the lengths of cols/rows if its an array, sometimes you can find the answer based off just that</p>