Question: The recursive formula for Binomial Coefficient C(n, k) is given by C(n, k) = C(n-1, k-1)+ C(n-1, k). Consider the following dynamic programming implementation
The recursive formula for Binomial Coefficient C(n, k) is given by C(n, k) = C(n-1, k-1)+ C(n-1, k). Consider the following dynamic programming implementation for Binomial Coefficient. Which of the following lines completes the below code? int binomial_coefficient (int n, int k). { } int i, j; int C[n]; for(i= 1; i < =n; i++) { } for(j=0; j < = mimimum (i, k); j++) { } return C[n] [k]; if (j==0 || j == 1) else C [i] [j] =1; OA. Clillil - C[n-1, k-1]+ C[n-1, kl OB. C[i][i] = C[i-1, j-1] + C[i-1.j] OC. C[i]li] = Cli, j-1] + Cli, j]
Step by Step Solution
There are 3 Steps involved in it
The correct line of code that completes the implementation is B Cii Ci 1i 1 Ci 1i This is ... View full answer
Get step-by-step solutions from verified subject matter experts
