Write a function that takes two parameters n and k and returns the value of Binomial Coefficient C(n, k).
The value of C(n, k) can recursively calculated using following standard formula for Binomial Cofficients.
C(n, k) = C(n-1, k-1) + C(n-1, k)
C(n, 0) = C(n, n) = 1
Refer : http://www.geeksforgeeks.org/archives/17806
The value of C(n, k) can recursively calculated using following standard formula for Binomial Cofficients.
C(n, k) = C(n-1, k-1) + C(n-1, k)
C(n, 0) = C(n, n) = 1
Refer : http://www.geeksforgeeks.org/archives/17806
No comments:
Post a Comment