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: | Sunday, 16 March 2025, 4:48 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
Date | Section | Lab No. (Topic) | Lab + G1 VIVA | G2 VIVA |
14/07/2021 | A | Lab 5.1 (Coin Change) | https://drive.google.com/file/d/1k94qBPR5RJZFXEPFCzW0pg3JFwd47DH3/view | https://drive.google.com/file/d/1Cph0Fv1n8mqM6RUC4wGUXKYnmUFQC-rh/view |
27.07.2021 | B | Lab 5.1 (Coin Change) | https://drive.google.com/file/d/1tVIsvFURcCQJpGJNEldoECqMLi_lMLXK/view | https://drive.google.com/file/d/183etKPQCzM6J9lEI-EajHgVxjxrX_wDZ/view |
28.07.2021 | A | Lab 5.2 (Bin Packing) | https://drive.google.com/file/d/17CBe3Cuf5Rdxz2b_OuSMcpdk7bPt2U3B/view | https://drive.google.com/file/d/1RMIOPrkJGfl-km26WFyTGujLN7vo4HKN/view |
03.08.2021 | B | Lab 5.2 (Bin Packing) | https://drive.google.com/file/d/1LaZJ_wqqaDnJ37eQ21qwFW4akDAmFsd_/view | https://drive.google.com/file/d/1mD2MRI2EMsdKYuZ_SUcxYgY6xS-8-iw5/view |