Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a C++/java program for the following algorithm design assignment: Design a

ID: 3679466 • Letter: W

Question

Write a C++/java program for the following algorithm design assignment:

Design an algorithm using the dynamic programming algorithm design paradigm that solves the following problem in O(n^2) time

Lets say we have n boxes,each box is a rectangular cube with different widths and lengths.the height of all cubes is 1 unit.we want to build a tower using these n boxes such that every box is bigger than all the boxes above it->meaning if the i'th box has a width of 10 and a length of 8 the (i+1)'th box must have a width of 10 or less and a height of 8 or less.

Note that we CANNOT rotate the boxes, so if a box has a width of 10 and a length of 8, we cannot rotate it so that it will have a length of 10 and width of 8 units

Write a program that calculates the maximum height the tower can possibly have.

The input format is as follows:

The first line is the number of inputs n

The next n lines are the width and heights of the n boxes

Input example 1:

output:

input example 2:

output:

input example 3:

output:

WARNING: must use the Dynamic Programming algorithm design paradigm or solution wont be accepted by professor
Thanks!

O. 3 139 3827

Explanation / Answer

IN java

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote