Question: If I could get some help! Here is the question: You are given a string of yarn of length n meters, and your goal is
If I could get some help! Here is the question:
You are given a string of yarn of length n meters, and your goal is to cut this yarn into integer-length pieces. For every integer 1..n you know the selling price of a piece of yarn of that length. Call the selling price of a string of yarn of length i by pi 0. Give an algorithm to compute the maximum amount of money that you could make by cutting the string into integer-length pieces. Your algorithm must run in time O(n^2 ).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
