
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

ECS122A: Algorithm Design and Analysis Due: 4:00pm, Monday, April 13, 2009 Homework Assignment #
(a) The “obvious” algorithm makes 2n − 2 comparisons. Explain. (b) Can we do it better? Carefully specify a more efficient divide-and-conquer algorithm. (c) Let T (n) = the number of comparisons your algorithm makes. Write a recurrence relation for T (n). (d) Show that your recurrence relation has as its solution T (n) = 3n/ 2 − 2.