



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
This document is a summary of the complexity of recursive algorithms. You can learn concisely about this subject.
Typology: Summaries
1 / 5
This page cannot be seen from the preview
Don't miss anything!
Review : Time Complexity T(n) ≈ copC(n) Where : T(n) : running time n : input size cop : execution time for basic operation C(n) : number of times basic operation is executed Counting the number of times the algorithm’s basic operation is executed on input of size n. There are several things to consider about recursive algorithm :
tn = tn- 1 + tn- 2 tn - tn- 1 + tn- 2 = 0
t 1 = 1 t 1 = 1 Homogeneous Linear Recurrence The following are homogeneous linear recurrence equations with constant coefficients: 7tn – 3tn- 1 = 0 6tn – 5tn- 1 + 8tn- 2 = 0 8tn – 4tn- 3 = 0 a 0 tn + a 1 tn- 1 + … + aktn-k = 0
Theorem Let r be a root of multiplicity m of the characteristic equation for a homogeneous linear recurrence with constant coefficients. Then tn = rn, tn = nrn. tn = n^2 rn, tn = n^3 rn, …, tn = nm-^1 rn are all solution to the recurrence. To be continued in part 2
References Levitin’s book (Section 2.4) Neapolitan’s book (Appendix B)