You are given wooden cuboids with certain length, width and fixed height.
You have to place them one above the another with condition that whenever a cuboid is palced over another, its lenght and width should be within the lower cuboid. (less than or equal to).
Create an algo to achieve optimum height for given set of cuboids.
Subscribe to:
Post Comments (Atom)
1.Sort the cuboids with length in decreasing order
ReplyDelete2.Now place the cuboids one over the other starting from the last cuboid in the sorted list