Skip to content
CalcGospel 國際數學圖譜
返回

IAL 2023 Jan D1 Q3

A Level / Edexcel / D1

IAL 2023 Jan Paper · Question 3

题目

Problem

1.81.42.61.62.80.93.10.81.22.40.61.8 \quad 1.4 \quad 2.6 \quad 1.6 \quad 2.8 \quad 0.9 \quad 3.1 \quad 0.8 \quad 1.2 \quad 2.4 \quad 0.6

(a) Use the first-fit bin packing algorithm to determine how the numbers listed above can be packed into bins of size 5.

(3)

The list is to be sorted into descending order.

(b) (i) Perform one pass of a bubble sort, starting at the left-hand end of the list. You must write down the list that results at the end of the first pass.

(ii) Write down the number of comparisons and the number of swaps performed during the first pass.

(3)

After a second pass using this bubble sort, the updated list is

2.61.82.81.63.11.41.22.40.90.80.62.6 \quad 1.8 \quad 2.8 \quad 1.6 \quad 3.1 \quad 1.4 \quad 1.2 \quad 2.4 \quad 0.9 \quad 0.8 \quad 0.6

(c) Use a quick sort on this updated list to obtain the fully sorted list in descending order. You must make your pivots clear.

(4)

(d) Apply the first-fit decreasing bin packing algorithm to the fully sorted list to pack the numbers into bins of size 5.

(3)
题目中文翻译

1.81.42.61.62.80.93.10.81.22.40.61.8 \quad 1.4 \quad 2.6 \quad 1.6 \quad 2.8 \quad 0.9 \quad 3.1 \quad 0.8 \quad 1.2 \quad 2.4 \quad 0.6

(a) 使用首次适应装箱算法确定上面列出的数字如何装入大小为 5 的箱子中。

列表要按降序排序。

(b) (i) 从列表左端开始执行一次冒泡排序传递。必须写出第一次传递结束时的结果列表。

(ii) 写出第一次传递期间执行的比较次数和交换次数。

使用此冒泡排序进行第二次传递后,更新的列表为

2.61.82.81.63.11.41.22.40.90.80.62.6 \quad 1.8 \quad 2.8 \quad 1.6 \quad 3.1 \quad 1.4 \quad 1.2 \quad 2.4 \quad 0.9 \quad 0.8 \quad 0.6

(c) 对此更新的列表使用快速排序获得降序完全排序的列表。必须清楚标出枢轴。

(d) 对完全排序的列表应用首次适应递减装箱算法,将数字装入大小为 5 的箱子中。

解答