This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: COT 5405 Analysis of Algorithms, Spring 2010. Midterm 2 March 18, 2010 Name: UFID: – Notes • This is a closed-book exam. No calculator. • You have 100 minutes for the exam. • If the problem necessitates writing an algorithm, you must first informally describe the algorithm, in brief, in a paragraph. You can choose to follow this up with pseudocode that formally describes the algorithm. We will peruse your pseudocode only if your English description is not clear. • Write your name on the top right hand corner of your homework. Be sure to write your last name as the last word in your name. • If you are designing an algorithm, you must write a formal proof of correctness. • Please write legibly. 1 1. [1 page][33points] Suppose we have a set of activities to schedule among a large number of lecture halls. We wish to schedule all the activities using as few lecture halls as possible. For example, we want to schedule 3 activities, which require 2 hours from 9AM to 11AM, 3 hours from 10AM to 1PM and 4 hours from 11AM to 3PM, respectively, with 3 lecture halls. The minimum number of lecture halls is 2, where the activities of (9AM–11AM) and (11AM–3PM) are scheduled in the same lecture hall and the activity of (10AM–1PM) is scheduled in another lecture hall. Give an optimal greedy algorithm to minimize the number of lecture halls and determine which activity should use which lecture hall and show that the algorithm is optimal.(Suppose there are always enough lecture halls)show that the algorithm is optimal....
View Full Document
This note was uploaded on 01/15/2012 for the course COT 5405 taught by Professor Ungor during the Fall '08 term at University of Florida.
- Fall '08