Consider strings over the alphabet Σ = {a, b}, and the function count(n) that returns the
number of strings of length n containing more a’s than b’s. For example, for n = 3, there
are four such strings, namely, [”aaa”, ”aab”, ”aba”, ”baa”], so the count is 4. Implement the
function in Java using recursion (Assume that you are not allowed to use any formula for the
count.)
I appreciate any help with this assignment, I'm completely stuck. Here's where's my head is at:
static int count(int n, int c) {
int a = 0;
int b = 0;
}
static int count() {
int c = 0;
return c;
}