Queues and Stacks (AQA A-Level Computer Science): Quizzes
📚Quizzes
Practise the questions
10 questions from this quiz
ShowHide
Practise the questions
10 questions from this quiz
What is an abstract data type?
What is an abstract data type?
A theoretical structure built by programmers
Which principle do stacks follow?
Which principle do stacks follow?
LIFO (Last In First Out)
What is the operation called when you view the top stack item without removing it?
What is the operation called when you view the top stack item without removing it?
Peeking
What error occurs when you try to pop from an empty stack?
What error occurs when you try to pop from an empty stack?
Stack underflow
What happens to the stack pointer when you push an item?
What happens to the stack pointer when you push an item?
It moves up to the new top element
Which application uses stacks to store return addresses?
Which application uses stacks to store return addresses?
Function calls (stack frames)
Which principle do queues follow?
Which principle do queues follow?
FIFO (First In First Out)
What advantage does a circular queue have over a linear queue?
What advantage does a circular queue have over a linear queue?
Reuses freed memory at the front
In a circular queue, what happens when the rear pointer reaches the array end?
In a circular queue, what happens when the rear pointer reaches the array end?
It wraps around to position 0
In priority queue Method 1, which operation is more complex?
In priority queue Method 1, which operation is more complex?
Removing items
