Question: Problem 5. Optional (25 points) You are given a sequence of n songs where the ith song is li minutes long. You want to place

 Problem 5. Optional (25 points) You are given a sequence of

Problem 5. Optional (25 points) You are given a sequence of n songs where the ith song is li minutes long. You want to place all of the songs on an ordered series of CDs (e.g. CD 1, CD 2, CD 3,...,CD k) where each CD can hold m minutes. Furthermore, (1) The songs must be recorded in the given order, song 1, song 2,..., song n (2) All songs must be included (3) No song may be split across CDs Your goal is to determine how to place them on the CDs as to minimize the number of CDs needed. Give the most efficient algorithm you can to find an optimal solution for this problem, prove the algorithm is correct and analyze the time complexity

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!