Cambridge International A Level · Computer Science (9618)

Computational thinking and Problem-solving:練習題

2 條多項選擇題即時批改,另有 5 條文字題附完整解題步驟,全部圍繞「Computational thinking and Problem-solving」。

7 條題目21 免費,無需登記
第 1 題
1

Which of the following is a necessary condition that must be met before a binary search algorithm can be used on a list of data items?

第 2 題
1

Consider the following recursive pseudocode function:

FUNCTION Calculate(n)
    IF n = 1 THEN
        RETURN 1
    ELSE
        RETURN n + Calculate(n - 1)
    END IF
END FUNCTION

What is the value returned by Calculate(4)?

第 3 題
2

State the Big O time complexity for finding a specific item in a sorted array containing \(n\) elements using binary search.

先自己寫一次答案,再對照解題步驟。

第 4 題
3

A programmer uses a stack Abstract Data Type (ADT) to support undo functionality. Explain why a stack is the most suitable data structure for this purpose.

先自己寫一次答案,再對照解題步驟。

第 5 題
5

Explain the role of the call stack during the execution of a recursive function, specifically stating what is stored during recursive calls and what occurs during the unwinding phase.

先自己寫一次答案,再對照解題步驟。

第 6 題
4

(a) Stepwise refinement is a key technique in computational thinking. Explain the purpose of using stepwise refinement when designing a complex computer program.

(b) A programmer is designing an algorithm to calculate the total price of a customer's order. The algorithm takes the Unit Price and the Quantity of an item as input, calculates the Subtotal, applies a 10% discount if the Subtotal is over \( 100 \), and then outputs the Final Total.

Complete the following identifier table for this algorithm by providing the data types and descriptions for the four variables mentioned.

先自己寫一次答案,再對照解題步驟。

第 7 題
5

A 1D array, MyList, contains 100 integer elements. A programmer needs to design an algorithm to search for a specific value, SearchValue, within this array.

(a) Write pseudocode for a linear search algorithm to find SearchValue in MyList. If the value is found, output its index position; otherwise, output a message stating the value was not found.

(b) Explain one reason why a linear search would be chosen over a binary search for this specific array.

先自己寫一次答案,再對照解題步驟。

* thinka提供的內容由AI生成,可能並非總是準確或最新。請將其用作輔助資源,並與官方材料進行核實。

你已看過標準答案,接下來輪到批改你的答案。

這一頁可以告訴你好答案的樣子,卻無法指出你的答案欠缺什麼。thinka 按真實評分準則批改你的文字答案,約 15 秒完成。

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

立即練習