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

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

View Full Document Right Arrow Icon
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
Image of page 1

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

View Full Document Right Arrow Icon
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)
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern