DevX Home Today's Headlines   Articles Archive   Tip Bank   Forums

1. Registered User
Join Date
Nov 2002
Posts
2

## Help in algorithm

>>>>>>>>
The binomial coefficients can be defined by recurrence equations:

C(n,0) =1 for n>=0

C(n,k) = 1 for n=k

C(n,k)=C(n-1, k-1)+C(n-1, k) for n>k>0

Write a piece of code to compute C(n,k) for n>=k>=0 for each of the following four ways. Determine basic operation for each method and calculate the amount of time for each one. Compare space requirements.

Write recursive method using the above recurrence equations.

Write method by using dynamic algorithm

Write method by using formula C(n,k) = n(n-1)(n-2)...(n-k+1) / k!

Write method by using formula C(n,k) = n! / ( k! (n-k)! )<<<<<<<

Thanks:
email: desi2go@yahoo.com

2. Registered User
Join Date
Jul 2002
Posts
26
You are not going to get a whole bunch of help on assignments that you are suppose to do yourself. If you have a specific question to ask, we could be of more help.

-gc

3. Registered User
Join Date
Nov 2002
Posts
2
Hi, This is not an assignment or any sort of thing. It's one of the excercise in my book I'm reading for my own knowledge. I just want to know more about computer science. I'm majorred in MIS. So, i was reading this book and came to this excercise, which have no answers in the back. I'd appreciate it if you can really help me out in neways showring me the direction to work this . Thanks

4. Registered User
Join Date
Jul 2002
Posts
26
Well, I would suggest that you post some sample code that you may have. If you have not yet written any code, you may want to ask more specific questions. What exactly are you stuck on? I am sure that a number of people could just give you the answer, but you might get more out of it if you tried implementing yourself.

-gc

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

 FAQ Latest Articles Java .NET XML Database Enterprise

×