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

IAL 2023 June D1 Q2

A Level / Edexcel / D1

IAL 2023 June Paper · Question 2

题目

Problem

A list of eleven numbers is to be sorted into descending order.

After one pass, the quick sort algorithm produces the following list

1733142523282113961017 \quad 33 \quad 14 \quad 25 \quad 23 \quad 28 \quad 21 \quad 13 \quad 9 \quad 6 \quad 10

(a) State, with a reason, which number was used as a pivot for the first pass.

(1)

(b) Starting at the left-hand end of the above list, obtain the fully sorted list using a bubble sort. You need to write down only the list that results at the end of each pass.

(3)

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

(2)
题目中文翻译

一个包含十一个数字的列表要按降序排序。

经过一次传递后,快速排序算法产生以下列表

1733142523282113961017 \quad 33 \quad 14 \quad 25 \quad 23 \quad 28 \quad 21 \quad 13 \quad 9 \quad 6 \quad 10

(a) 说明哪个数字被用作第一次传递的枢轴,并给出理由。

(b) 从上面列表的左端开始,使用冒泡排序获得完全排序的列表。只需写出每次传递结束时的结果列表。

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

解答