Question: Write a Java program that finds the heaviest stack of boxes that you can create out of a set of boxes given as input. Input:

Write a Java program that finds the heaviest stack of boxes that you can create out of a set of boxes given as input. Input: The input to the program is a file containing a set of boxes. Each line of the input file represents one box with 4 numbers, in the following format: Name Height Width Depth Weight. Depth always 2 width Rules for Box Stacking: A box X may be stacked on top of another box Y if and only if both of the following conditions hold: X has a footprint no bigger than Y in either width or depth (so if you stack X on Y, there is no overhang) . Box X weiahs no more than box Y. Algorithm: You must do a dynamic programming algorithm for this
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
