Midterm2sol2 - COT 5405 Analysis of Algorithms, Spring...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the 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 (9AM11AM) and (11AM3PM) are scheduled in the same lecture hall and the activity of (10AM1PM) 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

Page1 / 6

Midterm2sol2 - COT 5405 Analysis of Algorithms, Spring...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online