Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Erica is an undergraduate student at USC, and she is preparing for a very important exam. There are n days left for her to review

Erica is an undergraduate student at USC, and she is preparing for a very important exam. There are n days left for her to review all the lectures. To make sure she can nish all the materials, in every two consecutive days she must go through at least k lectures. For example, if k = 5 and she learned 2 lectures yesterday, then she must learn at least 3 today. Also, Ericas attention and stamina for each day is limited, so for ith day if Erica learns more than ai lectures, she will be exhausted that day. You are asked to help her to make a plan. Design an Dynamic Programming algorithm that output the lectures she should learn each day (lets say bi), so that she can nish the lectures and being as less exhausted as possible(Specically, minimize the sum of max(0,bi ai)). Explain your algorithm and analyze its complexity.

hint: k is O(n)

NOTE: WE DO NOT KNOW THE TOTAL NUMBER OF LECTURES. WE ARE ONLY GIVEN THAT k is O(n) AS A HINT.

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

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Shamkant B. Navathe

7th Edition Global Edition

1292097612, 978-1292097619

More Books

Students also viewed these Databases questions

Question

Where those not participating, encouraged to participate?

Answered: 1 week ago