Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Pls write the entire solution 1. Consider a set S of n classes, where each class i has a start time s, and a finish

Pls write the entire solution image text in transcribed
1. Consider a set S of n classes, where each class i has a start time s, and a finish time f We want to broadcast an announcement that will be heard by all classes; if the announcement is broadcast at time t, then all classes i such that stsf, will hear the announcement. We are wlling to broadcast the announcement multiple times, so we can hit all classes, but we want to minimize the uber of broadcasts. (a) Consider a greedy approach that repeatedly picks the midpoint of the shortest remaining class, and then removes all classes that are hit by that broadcast time Give and demonstrate a counterexample to show that this approach does not always find the minimber of broadcast times. (b) Design and write a greedy algorithm that, given the start times s, and finish times fi for each class, will find a minimum size set of times when the announcements can be broadcast in order to hit all classes. c) Prove that your algorithm from (b) is correct 1. Consider a set S of n classes, where each class i has a start time s, and a finish time f We want to broadcast an announcement that will be heard by all classes; if the announcement is broadcast at time t, then all classes i such that stsf, will hear the announcement. We are wlling to broadcast the announcement multiple times, so we can hit all classes, but we want to minimize the uber of broadcasts. (a) Consider a greedy approach that repeatedly picks the midpoint of the shortest remaining class, and then removes all classes that are hit by that broadcast time Give and demonstrate a counterexample to show that this approach does not always find the minimber of broadcast times. (b) Design and write a greedy algorithm that, given the start times s, and finish times fi for each class, will find a minimum size set of times when the announcements can be broadcast in order to hit all classes. c) Prove that your algorithm from (b) is correct

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_2

Step: 3

blur-text-image_3

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 Processing

Authors: David M. Kroenke

12th Edition International Edition

1292023422, 978-1292023427

More Books

Students also viewed these Databases questions