Create a recursive algorithm


Discussion:

Q: How many ways a committee of 4 people can be selected from a group of 10 is known as a combination. The notation in general for counting the number of ways of selecting r items from a group of n is C(n,r) = n! / r!(n-r)!

Also, given that 0! = 1 by definition, we can show that C(n,0) = 1 = C(n,n)

Also, C(n,r) = C(n-1, r-1) + C(n-1, r)

Given the information above, write a recursive algorithm to find C(n,r) for any two non-negative integers n and r, with r <=n

Solution Preview :

Prepared by a verified Expert
Data Structure & Algorithms: Create a recursive algorithm
Reference No:- TGS01936185

Now Priced at $25 (50% Discount)

Recommended (93%)

Rated (4.5/5)