题目
The numbers in the list below represent the weights, in kilograms, of ten crates. The crates are to be transported in trucks that can each hold a maximum total crate weight of 300 kg.
(a) Calculate a lower bound for the number of trucks that will be needed to transport the crates.
(b) Using the list provided, carry out a bubble sort to produce a list of the weights in descending order. You need only give the state of the list after each pass.
(c) Use the first-fit decreasing bin packing algorithm to allocate the crates to the trucks.
题目中文翻译
下面列表中的数字代表十个板条箱的重量(单位:千克)。板条箱将用卡车运输,每辆卡车最多可容纳总板条箱重量为 300 kg。
(a) 计算运输板条箱所需卡车数量的下界。
(b) 使用提供的列表,执行冒泡排序以产生降序的重量列表。只需给出每次传递结束后的列表状态。
(c) 使用首次适应递减装箱算法将板条箱分配给卡车。