AQA A Level · Computer Science 7517

Sorting algorithms:練習問題

その場で採点される選択問題 5 問と、解説つきの記述問題 5 問。すべて「Sorting algorithms」からの出題です。

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 秒で採点します。

同じような問題をもっと解きたい?このトピックの新しい問題を、解きながら採点。

練習を始める