Question: 5. (10 points) Greedy Algorithms You were planning to study real hard this quarter so you took out n books on algorithms. However you had

 5. (10 points) Greedy Algorithms You were planning to study realhard this quarter so you took out n books on algorithms. However

5. (10 points) Greedy Algorithms 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) ( point) Consider the case where you have taken out 7 books. The list T has your estimated reading time for each book T-11,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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!