Unformatted text preview: Give a recursive (divide and conquer idea) function (in a pseudo-code) to compute C(n,m). b. What is the worst case running time for 10(a) as a function of n? c. Give a dynamic programming algorithm to compute C(n,m). Hint. The algorithm constructs a table generally known as Pascal’s triangle. d. What is the worst case running time for 10(c) as a function of n? Try to be as exact as possible. a. Function RCOMBINATION(n,m):integer begin if m==0 or m==n then begin RCOMBINATION:=1; return; end RCOMBINATION:= RCOMBINATION(n-1,m)+ RCOMBINATION(n-1,m-1); end...
View Full Document
This note was uploaded on 12/10/2009 for the course CAS 2c03 taught by Professor Janicki during the Spring '03 term at McMaster University.
- Spring '03