Answered step by step
Verified Expert Solution
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 A 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 : Sort the activities according to their start times such that s s sn
Consider activities A A An in this order, and schedule Ai to the room if it does not overlap with any class already scheduled.
Algorithm : Sort the activities according to their finishing times such that f ffn Consider activities A A 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started