final1f03

# final1f03 - (so that the th row is followed by the st row)....

This preview shows page 1. Sign up to view the full content.

Final 1 : COT5405 Fall ’03 Time: 120 minutes Open Book; Open Notes 1. (25 pts) Solve the following recurrence relation without using the master theorem . Your ﬁnal solution should be in notation. . Assume . 2. (15+10 pts) Consider a binary Min-Heap as discussed in class, represented in an array . a. Suppose you need to change the value of its th element. Give an efﬁcient algorithm that sets and restores the heap property. b. Analyze and give an asymptotic upper bound on the time complexity of your algorithm. 3. (25 pts) If a graph has a -clique, it is clear that any coloring of the vertices (such that no two adjacent vertices are colored the same) must use at least colors. However, colors may not be sufﬁcient. Give an example of a graph in which the largest clique size is ,but colors are needed to color the graph. You have to prove that the graph is not -colorable. 4. (10+10+5 pts) Consider as input an array of positive integers wrapped around a cylinder
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: (so that the th row is followed by the st row). A path across the cylinder is a succession of n array elements, such that the ﬁrst element in the path is an element of the ﬁrst column, the last element in the path is an element of the last column, and an element can be followed only by one of the three adjacent elements in the next column, namely, , , or (where all arithmetic is done modulo n). The cost of a path is simply the sum of the values of the elements in the squares crossed on the path. a. Give a recurrence relation for Min-Cost(i,j), the miminum cost of a path starting at the ﬁrst column and reaching element . b. Use the recurrence relation to design an efﬁcient algorithm which ﬁnds a minimum-cost path across the cylinder. c. Analyze and give an asymptotic upper bound on the time complexity of your algorithm. 1...
View Full Document

## This note was uploaded on 05/27/2011 for the course COT 5405 taught by Professor Ungor during the Fall '08 term at University of Florida.

Ask a homework question - tutors are online