Question: Rewrite the preceding program so that it finds an optimal solution that packs all objects using the smallest number of containers. Here is a sample
Rewrite the preceding program so that it finds an optimal solution that packs all objects using the smallest number of containers. Here is a sample run of the program:
What is the time complexity of your program?
Enter the number of objects: 6 |-Enter Enter the weights of the objects: 7 5 2 3 5 8 Container 1 contains objects with weight 7 3 Container 2 contains objects with weight 5 5 Container 3 contains objects with weight 2 8 The optimal number of bins is 3 - Enter
Step by Step Solution
3.42 Rating (165 Votes )
There are 3 Steps involved in it
Program Plan Take input from user the numbers of objects and their weights generatePermutation method returns an Arraylist of Arraylist of Integer typ... View full answer
Get step-by-step solutions from verified subject matter experts
