AQA A Level · Computer Science 7517

排序演算法:练习题

5 道选择题即时批改,另有 5 道文字题附完整解题步骤,全部围绕「排序演算法」。

10 道题目22 免费,无需注册
第 1 题
1

A bubble sort algorithm is being used to sort the list [7, 4, 9, 2]. How many comparisons will be performed in total during the first pass of the algorithm?

第 2 题
1

A bubble sort algorithm is used to sort a list of 6 elements. In the worst-case scenario, where the list is in descending order and must be sorted into ascending order, how many total comparisons are made if no early-exit optimization is used?

第 3 题
1

Which of the following statements correctly distinguishes merge sort from bubble sort regarding space complexity?

第 4 题
1

Which of the following describes the fundamental approach used by the merge sort algorithm?

第 5 题
1

During the merge sort of a list with 8 elements, what is the maximum number of times the list is split (the depth of the recursion tree)?

第 6 题
2

Identify the time complexity of the bubble sort algorithm in its worst-case scenario and explain why it is considered particularly inefficient for large datasets.

先自己写一遍答案,再对照解题步骤。

第 7 题
4

Explain the Divide and Conquer strategy used by the merge sort algorithm during its execution.

先自己写一遍答案,再对照解题步骤。

第 8 题
4

A dataset consists of a very large list of names. If memory efficiency is a higher priority than raw processing speed, explain why bubble sort might still be rejected in favour of merge sort despite the latter's higher space complexity.

先自己写一遍答案,再对照解题步骤。

第 9 题
3

An array of integers is currently in the following order: [25, 14, 3, 10, 5]. A bubble sort algorithm is applied to sort the array into ascending order.

(a) State the state of the array after the first complete pass.
(b) Explain why bubble sort has a worst-case time complexity of \(O(n^2)\).

先自己写一遍答案,再对照解题步骤。

第 10 题
4

A programmer is choosing between Bubble Sort and Merge Sort for a dataset of size \(n\).

(a) State the worst-case time complexity for both algorithms using Big-O notation.
(b) Explain the 'Divide and Conquer' strategy used specifically by the Merge Sort algorithm.
(c) Under what specific condition would Merge Sort be significantly disadvantaged compared to Bubble Sort regarding space complexity?

先自己写一遍答案,再对照解题步骤。

* thinka 提供的内容由 AI 生成,未必在任何情况下都完全准确或最新,请结合官方教材与教师指导使用。

你已看过标准答案。现在轮到你的答案被批改。

这一页能告诉你好答案是什么样子,却无法指出你的答案缺了什么。thinka 按真实评分标准批改你的文字答案,约 15 秒完成。

想多做几道同类题目?立即开始练习这个课题,边做边批改。

立即练习