题目
The numbers in the list represent the weights, in kilograms, of twelve parcels. The parcels are to be transported in containers that will each hold a maximum weight of 45 kg.
(a) Calculate a lower bound for the number of containers needed. You must make your method clear.
(b) Use the first-fit bin packing algorithm to allocate the parcels to the containers.
(c) Carry out a bubble sort, starting at the left-hand end of the list, to produce a list of the weights in descending order. You should only give the state of the list after each pass.
(d) Use the first-fit decreasing bin packing algorithm to allocate the parcels to the containers.
题目中文翻译
列表中的数字代表十二个包裹的重量(单位:千克)。包裹将用容器运输,每个容器最多可容纳 45 kg。
(a) 计算所需容器数量的下界。必须清楚说明方法。
(b) 使用首次适应装箱算法将包裹分配给容器。
(c) 从列表左端开始执行冒泡排序,以产生降序的重量列表。应只给出每次传递结束后的列表状态。
(d) 使用首次适应递减装箱算法将包裹分配给容器。