Oxford AQA International A-level · Computer Science (9645)

堆疊:練習題

5 條多項選擇題即時批改,另有 5 條文字題附完整解題步驟,全部圍繞「堆疊」。

10 條題目23 免費,無需登記
第 1 題
1

In the context of a stack data structure, what is the term used for the operation of adding an item to the top of the stack?

第 2 題
1

Which of the following computational tasks is most appropriately solved using a stack data structure?

第 3 題
1

Consider two common scenarios: (i) Processing function calls and local variables during program execution, and (ii) Handling data requests sent to a shared server that processes them sequentially based on arrival time. Which data structures are most suitable for (i) and (ii) respectively?

第 4 題
1

A stack is initially empty. The following operations are performed in sequence:
1. Push(10)
2. Push(20)
3. Pop
4. Push(30)
5. Peek
What value is returned by the Peek operation?

第 5 題
1

An empty stack S is manipulated using the following operations:
1. Push(A)
2. Push(B)
3. Pop()
4. Push(C)
5. Peek()
6. Pop()
If the Peek operation returns the value at the top without removing it, what is the final state of the stack (from bottom to top)?

第 6 題
2

Define the principle governing the operation of a Stack data structure and name the primary pointer used to track its active end.

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

第 7 題
3

Explain the role of the 'peek' operation on a stack, and how it differs functionally from the 'pop' operation.

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

第 8 題
5

When implementing a stack using a fixed-size array represented by STACK[0..N-1], and a stack pointer Top that points to the most recently added item, what precise condition must be met to test if the stack is full?

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

第 9 題
3

A stack is implemented using an array with a maximum capacity of 5. The stack currently contains the elements ['A', 'B', 'C'] where 'C' is the top of the stack.

(a) Define the term LIFO (Last-In, First-Out) in the context of a stack data structure.

(b) Describe the state of the stack contents (the list of elements) and identify the new top element after the following sequence of operations:
1. PUSH ('D')
2. PUSH ('E')
3. POP()
4. PUSH ('F')

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

第 10 題
5

When a subroutine is called, data is temporarily stored in a stack frame on the system stack.

(a) State two distinct types of data, other than parameters and return addresses, that may be stored in a stack frame when a subroutine is executed.

(b) Explain the importance of storing the return address within the stack frame during subroutine execution.

(c) Contrast the scope of a local variable defined within a subroutine with that of a global variable.

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

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

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

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

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

立即練習