0
How This made 7 can i get help is This add 2 in any circle or just one and then condition till the base case done
public class Program { private static int f(int i){ if (i<=0){ return 1; } else { return (2+f(i-1));i= 1 (return 1) } } public static void main(String[] args) { System.out.println(f(3)); } }
3 Antworten
+ 2
Remove the "i = 1 (return 1)". It seems that it's not needed there.
+ 2
Ya the calculation will be as what you stated there
0
Yes by wrong🤗
Is This in memory calc 2+2+2+1 ?