Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Suppose you have n lectures that need to be allocated to available classrooms. Each lecture i has a start time si and finish time fi.

image text in transcribed
Suppose you have n lectures that need to be allocated to available classrooms. Each lecture i has a start time si and finish time fi. Your goal is to assign lectures to rooms using as few rooms as possible. Of course, if two lectures overlap in time, they cannot share a room. (a) Consider the following greedy algorithm skeleton: 1 Sort lectures in some way (tbd) 23d0forj1ton do if lecture j is compatible with some classroom k then schedule lecture j in classroom k else allocate a new classroom d+1 schedule lecture j in classroom d+1 dd+1 You remember that you learned about interval scheduling in class, and for that problem you needed to sort by finish times. Show by counter-example that sorting by finish times doesn't always work here

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

4th Edition

0805360476, 978-0805360479

More Books

Students also viewed these Databases questions