Consider the following function:
void asterisksPrinter(int i) {
if (i > 1) {
asterisksPrinter(i / 2);
asterisksPrinter(i / 2);
}
System.out.print("*");
}
How many asterisks are printed by the method call
asterisksPrinter(i)?
(Either write a number, or write "infinite recursion".)
ANS
Note that there are two recursive calls.
Don't forget that the print statement will be executed on the rollback for EACH of the recursive calls.