Recursion. The binomial coefficients can be represented by the following recursive?

ABF

New member
Recursion. The binomial coefficients can be represented by the following recursive
definition.
c(n, k) = c( n-1, k-1) + c( n-1, k) for n >= 0 and 0 < k < n
c(n, 0) = c( n, n) = 1
a. Write a recursive method to calculate the binary coefficient for any n and k. The method
should throw an IllegalArgumentException if either of the arguments are invalid.

b. Trace the call c(4, 2).

c. Is this a good use of recursion? Explain your answer.
 
Back
Top