• :00Days
  • :00Hours
  • :00Mins
  • 00Seconds
A new era for learning is coming soonSign up for free
Log In Start studying!

Select your language

Suggested languages for you:
Answers without the blur. Sign up and see all textbooks for free! Illustration

Q59E

Expert-verified
Discrete Mathematics and its Applications
Found in: Page 204
Discrete Mathematics and its Applications

Discrete Mathematics and its Applications

Book edition 7th
Author(s) Kenneth H. Rosen
Pages 808 pages
ISBN 9780073383095

Answers without the blur.

Just sign up for free and you're in.

Illustration

Short Answer

a) Devise a greedy algorithm that determines the fewest lecture halls needed to accommodate n talks given the starting and ending time for each talk.

It is proved that the greedy algorithm does not always determine the fewest lecture halls needed to accommodate n talks given the starting and ending time for each talk.

See the step by step solution

Step by Step Solution

Step 1:

We know that an algorithm is a finite sequence of precise instructions for performing a computation or for solving a problem.

So, the one way to process is the order the talks by starting time. Then, we number the lecture halls and so on.

Now, we will see the greedy algorithm for scheduling talks:

Step 2:

e1e2enProcedure schedule

s1s2.sn : start times of talks, ( e1e2en : ending times of talks)

Sorts talk by finish time and reorder so that

For j : = 1

For i := 1 to N ( N is the number of lecture halls)

If talk j is compatible with i then we assign talk j to lecture hall i .

Therefore, it is proved that the greedy algorithm does not always determine the fewest lecture halls needed to accommodate n talks given the starting and ending time for each talk.

Recommended explanations on Math Textbooks

94% of StudySmarter users get better grades.

Sign up for free
94% of StudySmarter users get better grades.