

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
A homework assignment for cs 361: algorithms and complexity analysis, taught by prof. Jared saia at the university of new mexico. The assignment covers the analysis of recurrence relations using the recursion tree method, annihilators, and the master theorem. Students are required to find tight upper bounds for the solutions to given recurrences and write recurrence relations for given functions, as well as analyze their running times.
Typology: Assignments
1 / 2
This page cannot be seen from the preview
Don't miss anything!


(a) Use the recursion tree method to get a tight upper bound (i.e. big-O) on the solution to this recurrence (b) Now use annihilators (and a transformation) to get a tight upper bound on the solution to this recurrence. Show your work. (Note that your two bounds should match)
(a) Use the Master method to get a general solution to this recur- rence. (b) Now use annihilators (and a transformation) to get a tight upper bound on the solution to this recurrence. Show your work. (Note that your two bounds should match)
int f (int n){ if (n==0) return 0; else if (n==1) return 1; else{ int val = 6f (n-1); val = val - 9f (n-2); return val; } }
(a) Write a recurrence relation for the value returned by f. Solve the recurrence exactly. (Don’t forget to check it)
(b) Write a recurrence relation for the running time of f. Get a tight upperbound (i.e. big-O) on the solution to this recurrence.
int f (int n){ if (n==0) return 0; else if (n==1) return 1; else{ int val = 4f (n-1); val = val - 4f (n-2); return val; } }
(a) Write a recurrence relation for the value returned by f. Solve the recurrence exactly. (Don’t forget to check it) (b) Write a recurrence relation for the running time of f. Get a tight upperbound (i.e. big-O) on the solution to this recurrence.