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

IAL 2025 June D1 Q3

A Level / Edexcel / D1

IAL 2025 June Paper · Question 3

题目

Problem

(i) A list of twelve numbers is to be sorted into ascending order.

2818502748825125631334228 \quad 18 \quad 50 \quad 27 \quad 48 \quad 8 \quad 25 \quad 12 \quad 56 \quad 31 \quad 33 \quad 42

(a) Use a quick sort to obtain the sorted list. You should show the result of each pass and identify your pivots clearly.

(4)

(b) Show how the binary search algorithm is used to try to locate the number 40 in the list. You must clearly indicate your choice of pivots and which part of the list you are rejecting.

(3)

(ii) A different list of nine distinct integers is to be sorted into descending order.

2320x321581962223 \quad 20 \quad x \quad 32 \quad 15 \quad 8 \quad 19 \quad 6 \quad 22

The list is sorted using bubble sort. The first three passes are

Pass 1232032x15198226
Pass 2233220x19152286
Pass 332232019x221586

Determine the range of possible values of xx.

(2)
题目中文翻译

(i) 一个包含十二个数字的列表需要按升序排列。

2818502748825125631334228 \quad 18 \quad 50 \quad 27 \quad 48 \quad 8 \quad 25 \quad 12 \quad 56 \quad 31 \quad 33 \quad 42

(a) 使用快速排序获得排序后的列表。应显示每一轮的结果并清楚标明基准元素。

(b) 展示二分搜索算法如何尝试在列表中定位数字 40。必须清楚说明基准元素的选择以及被排除的列表部分。

(ii) 另一个包含九个不同整数的列表需要按降序排列。

2320x321581962223 \quad 20 \quad x \quad 32 \quad 15 \quad 8 \quad 19 \quad 6 \quad 22

使用冒泡排序对该列表进行排序。前三轮如下:

第1轮232032x15198226
第2轮233220x19152286
第3轮32232019x221586

确定 xx 的可能值范围。

解答