Recursion. Breaking down problems into solvable subproblems Chapter 7. The good and the bad. Pluses Code easy to understand May give different view of problem Sometimes, efficient Bad overhead of functions calls (20-30%) may be hard to analyze cost not apparent
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
Breaking down problems into
m^k at depth k
Nodes in a Sk+1 trees is
# in Sk tree + m*number of leaves in Sk
= (mk+1-1)/(m-1) +m*mk
= (mk+1-1)/(m-1) + m^(k+2)/(m-1) -m^(k+1)/(m-1)
= (m^(k+2) -1)/(m-1)
if (n <= 1) return 1
else return fib(n-1)+ fib(n-2)
# of permutations of those invited is k!
# of permutations of those not invited is (n-k)!
Down: extend matching by deleting char si
Right: extend match by deleting char tj
Diagonal: extend match by substitution, if necessary