Quick question
public static int fun(int n, int k) {
if (k<= 0) return 2;
if (k>=n) return 5;
return fun(n-1, k-1) + fun(n-1, k);
}
Trying to get a feel for methods and how they work, especially being able to look at methods and try to tell what they do and what types of output I would get. For the above example, suppose I invoke the method with the following parameters fun(5,2), what would my output be?
Also, how would I invoke this method in my main()?
Much appreciate the help as always!
