Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are given n classes A 1 , , An such that each Ai is associated with [ si , fi ] where si and

You are given n classes A1,, An such that each Ai
is associated with [si, fi] where si and fi denote the start and the finishing time of Ai. You are to select the maximum number of classes that can be scheduled in a single classroom such that no two activities
can be scheduled unless they do not have an overlapping period. Consider the following two
algorithms. Only one of them produces an optimal solution. For each algorithm, prove its
correctness or give a counter example to disprove it.
Algorithm 1: Sort the activities according to their start times such that s1<= s2<=<= sn.
Consider activities A1, A2, An in this order, and schedule Ai to the room if it does not overlap with any class already scheduled.
Algorithm 2: Sort the activities according to their finishing times such that f1<= f2<=<=fn. Consider activities A1, A2, An in this order, and schedule Ai to the room if it does not overlap with any class already scheduled.

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

Database Design Query Formulation And Administration Using Oracle And PostgreSQL

Authors: Michael Mannino

8th Edition

1948426951, 978-1948426954

More Books

Students also viewed these Databases questions

Question

Have roles been defined and assigned?

Answered: 1 week ago