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 秒完成。

想多做幾條同類題目?立即開始練習呢個課題,即做即批改。

立即練習