Central binomial coefficient | Function to find the value of Nth Central Binomial Coefficient ; Calculate value of Binomial Coefficient in bottom up manner ; Base Cases ; Calculate value using previously stored values ; Driver Code
function binomialCoeff ( n , k ) { var C = Array . from ( Array ( n + 1 ) , ( ) => Array ( k + 1 ) ) ; var i , j ; for ( i = 0 ; i <= n ; i ++ ) { for ( j = 0 ; j <= Math . min ( i , k ) ; j ++ ) { if ( j == 0 j == i ) C [ i ] [ j ] = 1 ; else C [ i ] [ j ] = C [ i - 1 ] [ j - 1 ] + C [ i - 1 ] [ j ] ; } } return C [ n ] [ k ] ; } var n = 3 ; var k = n ; n = 2 * n ; document . write ( binomialCoeff ( n , k ) ) ;