Skip to content

Commit 4bb63a2

Browse files
authored
Merge pull request #36 from master-fury/master
Binomial Coefficient
2 parents 19d99be + c591c4e commit 4bb63a2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#Binomial Coefficient by Master-Fury
2+
3+
def binomialCoefficient(n , k):
4+
5+
if k==0 or k ==n :
6+
return 1
7+
8+
9+
return binomialCoefficient(n-1 , k-1) + binomialCoefficient(n-1 , k) # Recursive Call
10+
11+
# Driver Program
12+
n = 6
13+
k = 3
14+
print ("Value of C(%d,%d) is (%d)" %(n , k , binomialCoefficient(n , k)) )

0 commit comments

Comments
 (0)