Calculating binomial coefficients
A binomial coefficient \( C(n,k) \) can be calculated in many ways. One is through the recursive formula
\[\binom nk = \binom{n-1}{k-1} + \binom{n-1}k\]Since this recursion exhibits optimal substructure and overlapping subproblems it is a good candidate to be solved via dynamic programming
Time complexity is \( O(nk) \). Space complexity is also \( O(nk) \).