10 questions๐Ÿ‡ฌ๐Ÿ‡งEnglish

๐Ÿฅž Stacks, Queues & Linked Lists โ€“ A-level

Computer Science ยท A-level โ€” LIFO and FIFO structures, circular and priority queues, pointers and linked lists

Make it your own private quiz and change anything you like

Questions

Which principle describes the order in which items are removed from a stack?

Last in, first out
First in, first out
Highest priority, first out
Any item by its index
20s

Which stack operation returns the top item without removing it?

Peek
Pop
Push
Dequeue
20s

A program tries to pop an item from an empty stack. What is this error called?

Stack underflow
Memory leak
Stack overflow
Infinite recursion
20s

An empty stack runs: push 5, push 8, pop, push 3, push 9, pop, pop. Which item is now on top?

9
3
5
8
30s

An empty queue runs: enqueue A, enqueue B, enqueue C, dequeue, enqueue D, dequeue. Which item is now at the front?

B
C
D
A
30s

Why is a circular queue often preferred to a linear queue implemented in a fixed-size array?

It lets the array grow at run time
It keeps items sorted by priority
It removes items from either end
It reuses spaces freed at the front
30s

To delete a node from a singly linked list, what happens to the pointer in the node before it?

It points to the deleted node's data
It is set to null
It is set to point to the head node
It takes the value of the deleted node's pointer
30s

A circular queue uses an array with indices 0 to 7. The rear pointer is 7 and the queue is not full. What is rear after one enqueue?

7
0
1
8
30s

Which is an advantage of a static data structure, such as a fixed-size array, over a dynamic one?

Unused memory is returned to the heap
No extra memory is used to store pointers
It can grow when more items are added
It can never become full
30s

In a priority queue, two items have the same priority. Which of them is normally dequeued first?

The one with the smaller data value
The one that was enqueued last
The one that was enqueued first
The one chosen at random
30s