Popular Posts

Monday, April 4, 2011

Algo to achieve maximum height

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.

1 comment:

  1. 1.Sort the cuboids with length in decreasing order
    2.Now place the cuboids one over the other starting from the last cuboid in the sorted list

    ReplyDelete