Lab: Coin Change & Bin Packing

Site: DIU Blended Learning Center
Course: Algorithm -SMAH(Fall 2022)
Book: Lab: Coin Change & Bin Packing
Printed by: Guest user
Date: Friday, 27 September 2024, 5:26 AM

Greedy Coin Change Algorithm




Bin Packing Algorithm


Step 1: Sort the sections in terms of their sizes in decreasing order. 

Step 2: Set Count to 0 

Step 3: Assign sections to a minibus until the summation of the section sizes are less than or equal to C (the capacity of the minibus). Always choose the largest sized section from the sorted list of sections left. 

Step 4: Set Count to Count + 1 

Step 5: Repeat step 3 and step 4 until 0 sections left. 

Step 6: Return Count


Class Discussion: Week-5 (part 1)



Class Discussion: Week-5 PC-B (part 2)



Class Discussion: Week-5 PC-A (part 2)