Pearson Edexcel IGCSE · Computer Science

Algorithms:練習問題

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

9 問24 無料・登録不要
問 1
1

A developer needs to search for a specific name in a sorted list of 10,000 entries. Why would they choose a binary search instead of a linear search?

問 2
1

How many times will the total variable be incremented in the following nested loop structure?
FOR \(i\) FROM 1 TO 4
  FOR \(j\) FROM 1 TO 3
    SET \(total\) TO \(total + 1\)
  ENDFOR
ENDFOR

問 3
1

Which of these is the primary purpose of using a trace table during the development of an algorithm?

問 4
1

What is the maximum number of comparisons a binary search algorithm would need to find a value in a sorted list of \(15\) elements?

問 5
1

Given the list \([5, 2, 8, 1]\), what will the list look like after the first complete pass of a standard ascending bubble sort?

問 6
3

State the specific requirement that must be met by a data set before a binary search algorithm can be successfully performed.

まず自分で答えを書いてから、解説と照らし合わせましょう。

問 7
5

A sorted list contains 1,000 items. Determine the maximum number of comparisons required to find an item using a binary search and briefly justify your answer using powers of 2.

まず自分で答えを書いてから、解説と照らし合わせましょう。

問 8
4

A list of 1,000 student IDs is stored in an array. The IDs are already sorted in ascending order.
(a) State which search algorithm would be more efficient to find a specific ID in this sorted list.
(b) Explain why this algorithm is more efficient than a linear search by comparing the maximum number of checks required for each method.

まず自分で答えを書いてから、解説と照らし合わせましょう。

問 9
7

An array contains the following sequence of integers: [12, 5, 8, 2].
(a) Show the state of the array after each complete pass of a Bubble Sort algorithm until the numbers are in ascending order.
(b) Explain why a Merge Sort is generally considered more efficient than a Bubble Sort for very large datasets.

まず自分で答えを書いてから、解説と照らし合わせましょう。

※ thinkaのコンテンツはAIにより生成されているため、内容が正確でない場合があります。補助教材としてご使用いただき、公式の教材と合わせてご確認ください。

模範解答は見ました。次はあなたの答案を採点します。

このページは良い答案の形を示せますが、あなたの答案に何が足りないかは教えられません。thinka は実際の採点基準に沿って記述答案を約 15 秒で採点します。

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

練習を始める