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

Queues:練習問題

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

10 問26 無料・登録不要
問 1
1

What principle governs the way data is added to and removed from a queue data structure?

問 2
1

A standard linear queue is implemented in a program. If the following sequence of operations is performed on an initially empty queue, what value will be returned by the next DEQUEUE operation?

ENQUEUE(12)
ENQUEUE(24)
DEQUEUE()
ENQUEUE(36)

問 3
1

A circular queue is implemented in an array of size 8 (indices 0 to 7). The pointers are initialized as \( \text{Front} = 0 \) and \( \text{Rear} = -1 \). After performing three ENQUEUE operations and one DEQUEUE operation, what are the current values of the Front and Rear pointers?

問 4
1

When implementing a queue using a one-dimensional array, why is a circular queue implementation often preferred over a simple linear queue?

問 5
1

A circular queue is implemented using an array of size N. The queue uses integer pointers 'Front' and 'Rear' (representing indices) to track the elements. Which expression correctly indicates that the circular queue is full, assuming standard practice where one slot is kept empty to distinguish 'full' from 'empty'?

問 6
2

What is the primary operation used to add an item to a queue, and which end of the queue is this item added to?

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

問 7
3

Describe a typical real-world scenario in computer science where a Queue is the most appropriate data structure to manage tasks.

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

問 8
5

Given a circular queue implemented with an array of length \(L\), provide the calculation used to update the Rear pointer after a new item is enqueued, ensuring it wraps back to index \(0\) when necessary.

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

問 9
5

A circular queue is maintained in a one-dimensional array with 10 slots, using indices 0 to 9. The Front pointer currently stores the value 7 and the Rear pointer stores the value 2.
(a) Define the First-In, First-Out (FIFO) principle in the context of this queue. (1 point)
(b) Calculate the total number of items currently stored in the queue, showing your working. (2 points)
(c) Describe the state of the Rear pointer if three additional items are successfully enqueued. (1 point)
(d) Explain how a Linear Queue implementation would eventually fail to accept new items even if slots in the array are empty, and how the circular implementation solves this. (1 point)

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

問 10
6

A linear queue is implemented in an array Q of maximum size 10 (indices 0 to 9). The current state uses Front pointing to the index of the first item, and Rear pointing to the index of the last item. Initially, Front = -1 and Rear = -1.

(a) If 5 items are enqueued, and then 3 items are dequeued, determine the values of Front and Rear.

(b) Using the values calculated in part (a), describe the state of the queue array Q and explain why this implementation suffers from inefficient use of memory space.

(c) Propose two methods used in programming languages (including the use of specific data structures) to overcome the inefficiencies identified in part (b).

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

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

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

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

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

練習を始める