Binomial Coefficient | DP | Returns value of Binomial Coefficient C ( n , k ) ; Base Cases ; Recur ; Driver Code
< ? php function binomialCoeff ( $ n , $ k ) { if ( $ k > $ n ) return 0 ; if ( $ k == 0 $ k == $ n ) return 1 ; return binomialCoeff ( $ n - 1 , $ k - 1 ) + binomialCoeff ( $ n - 1 , $ k ) ; } $ n = 5 ; $ k = 2 ; echo " Value ▁ of ▁ C " , " ( " , $ n , $ k , " ) ▁ is ▁ " , binomialCoeff ( $ n , $ k ) ; ? >