Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is for an Introduction to Algorithms course, so no specific programming language should be used. Please write the algorithm in general pseudocode and provide

This is for an Introduction to Algorithms course, so no specific programming language should be used.

Please write the algorithm in general pseudocode and provide Proof of Correctness and Runtime Analysis.

Please show your work, and DO NOT use any pre-existing solutions to this question on Chegg Study.

image text in transcribed

image text in transcribed

You are given a rectangular piece of cloth with dimensions X XY, where X and Y are positive integers, and a list of n products that can be made using the cloth. For each product i you know that a rectangle of cloth of dimensions ai x b is needed and that the selling price of the product is ci Assume the di, bi and C; are all positive integers. You have a machine that can cut any rectangular piece of cloth into two pieces either horizontally or vertically. Design an algorithm that runs in time that is polynomial in X, Y, n and determines the best return on the X X Y piece of cloth, that is, a strategy for cutting the cloth so that the products made from the resulting pieces give the maximum sum of selling prices. You are free to make as many copies of a given product as you wish, or none, if desired. You are given a rectangular piece of cloth with dimensions X XY, where X and Y are positive integers, and a list of n products that can be made using the cloth. For each product i you know that a rectangle of cloth of dimensions ai x b is needed and that the selling price of the product is ci Assume the di, bi and C; are all positive integers. You have a machine that can cut any rectangular piece of cloth into two pieces either horizontally or vertically. Design an algorithm that runs in time that is polynomial in X, Y, n and determines the best return on the X X Y piece of cloth, that is, a strategy for cutting the cloth so that the products made from the resulting pieces give the maximum sum of selling prices. You are free to make as many copies of a given product as you wish, or none, if desired

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

PC Magazine Guide To Client Server Databases

Authors: Joe Salemi

1st Edition

156276070X, 978-1562760700

More Books

Students also viewed these Databases questions