Lesson 4.2.3.1

4.2.3.1 Stack operations Quiz: AQA Computer Science, Unit 2

20 questions

In partnership with Revision Ninja

Lesson 4.2.3.1, Stack operations: 20 multiple choice questions for the AQA Computer Science (7517), Unit 2: Fundamentals of data structures, written with Revision Ninja.

Host it live on the board and students join with a game code on their own devices, or revise alone with Free Play. The answers are revealed in the game.

Host this setFree Play

The 20 questions

  1. Which acronym describes the access order in which items are added and removed from a stack?

    • FIFO
    • GIGO
    • LIFO
    • FIPO
  2. Which operation adds an item to the top of a stack?

    • Peek
    • Push
    • Pop
    • Enqueue
  3. Which operation removes the top item of a stack?

    • Dequeue
    • Push
    • Pop
    • Peek
  4. What stack operation reads the top value without removing it from the stack?

    • Enqueue
    • Pop
    • Peek
    • Push
  5. Which condition must be checked before executing a pop operation on a stack?

    • Test for full
    • Test pointer limit
    • Test array capacity
    • Test for empty
  6. What error is prevented by testing if a stack is full before pushing a new item?

    • Null reference
    • Stack overflow
    • Stack underflow
    • Syntax error
  7. When implementing a stack using an array, what does the stack pointer store?

    • Front element index
    • Bottom element index
    • Top element index
    • Total array capacity
  8. Values 4, 7 and 9 are pushed onto an empty stack in that order. What value is popped first?

    • 4
    • 16
    • 7
    • 9
  9. A stack has 2 items. Which sequence leaves the stack with 1 item?

    • Pop twice
    • Peek twice
    • Push twice
    • Pop once
  10. Given the operations push(3), push(5), pop(), push(8), pop(), pop(), what is left on the stack?

    • Empty
    • 3
    • 5
    • 8
  11. A stack of capacity 3 contains 3 items. What occurs if another item is pushed?

    • Bottom item removed
    • Overflow error
    • Underflow error
    • Item is overwritten
  12. What data structure is used by the operating system to store return addresses for subroutines?

    • Call stack
    • Adjacency list
    • Circular queue
    • Priority queue
  13. Why is a stack suitable for checking whether brackets are balanced in an expression?

    • FIFO processing order
    • Dynamic sorting feature
    • LIFO matching property
    • Random access capability
  14. A stack is used to reverse the characters of the string ABC. Pushing A, B, C then popping all of them gives which output?

    • ACB
    • CBA
    • BCA
    • ABC
  15. An empty stack has a top index of -1. What is the top index after pushing one item?

    • -2
    • Null
    • 1
    • 0
  16. A program needs to undo the most recent action in an editor. Which ADT is most appropriate?

    • Graph
    • Hash table
    • Queue
    • Stack
  17. What is the result of pushing 1, 2, 3, then popping twice and peeking?

    • Empty
    • 1
    • 3
    • 2
  18. What error occurs when pushing an item onto a full fixed-size stack?

    • Syntax error
    • Stack underflow
    • Stack overflow
    • Type error
  19. What main advantage does a linked list stack implementation have over a fixed array implementation?

    • Dynamic memory size
    • Static memory size
    • Faster indexing
    • Lower memory overhead
  20. Which data structure accesses items in First In, First Out (FIFO) order?

    • Binary tree
    • Graph
    • Stack
    • Queue

All AQA Computer Science quizzes