Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You were planning to study real hard this quarter so you took out n books on algorithms. However you had better planning than execution

 

You were planning to study real hard this quarter so you took out n books on algorithms. However you had better planning than execution and you have not read a single book and they are now all overdue. The library charges one dollar a day for each overdue book. You have calculated for each book the number of days it will take you to read the book. You want to know what order to read (and return) the n books so that your overdue costs are minimized. a) (1 point) Consider the case where you have taken out 7 books. The list T has your estimated reading time for each book. T = [1,5,2,6,1,4,2] If you read the books in this order (and return a book when you are done) what will be the final cost? b) (2 points) What order should you read the books to minimize your costs? What is the cost when you read them in your suggested order? c) (2 points) Describe a greedy algorithm that will solve this problem for a general instance.

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

Microeconomics

Authors: Dean Karlan, Jonathan Morduch

1st edition

978-0077332587, 007733258X, 978-0077332648, 77332644, 978-1259163531

More Books

Students also viewed these Computer Network questions

Question

Identify the four schedules of reinforcement.

Answered: 1 week ago

Question

Define the term learning.

Answered: 1 week ago

Question

Identify the effects and dangers of using depressants.

Answered: 1 week ago