Lesson 4.3.1.1

4.3.1.1 Breadth-first and depth-first search Quiz: AQA Computer Science, Unit 3

20 questions

In partnership with Revision Ninja

Lesson 4.3.1.1, Breadth-first and depth-first search: 20 multiple choice questions for the AQA Computer Science (7517), Unit 3: Fundamentals of algorithms, 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 graph traversal algorithm guarantees finding the shortest path in an unweighted graph?

    • Binary search
    • Breadth-first search
    • Linear search
    • Depth-first search
  2. Which data structure does breadth-first search typically use to hold nodes waiting to be explored?

    • A stack
    • A heap only
    • A queue
    • A binary search tree
  3. Which primary data structure is used to track unexplored nodes in depth-first search?

    • Array
    • Queue
    • Priority queue
    • Stack
  4. According to the AQA specification, what is a typical application of depth-first search?

    • Shortest path finding
    • Sorting array data
    • Infix conversion
    • Navigating a maze
  5. In what order does a breadth-first search explore nodes from the start node?

    • Random order
    • Highest value first
    • Level by level
    • Path by path
  6. Which search goes as deep as possible along one path before backtracking?

    • Binary search
    • Linear search
    • Depth-first search
    • Breadth-first search
  7. In a breadth-first search, which node is removed from the queue next?

    • Highest weight node
    • Deepest child node
    • Latest added node
    • Earliest added node
  8. Graph edges: A-B, A-C, B-D, C-D, D-E. Starting at A and taking neighbours in alphabetical order, what is the breadth-first visit order?

    • A, B, D, C, E
    • A, B, C, E, D
    • A, E, D, C, B
    • A, B, C, D, E
  9. Using the same graph (A-B, A-C, B-D, C-D, D-E), starting at A and taking neighbours alphabetically, what is the depth-first visit order?

    • A, C, B, D, E
    • A, B, E, D, C
    • A, B, C, D, E
    • A, B, D, C, E
  10. In the same graph, what is the shortest number of edges from A to E?

    • 1
    • 4
    • 3
    • 2
  11. What technique does depth-first search perform when reaching a dead end in a maze?

    • Level traversal
    • Linear looping
    • Shortest pathing
    • Backtracking
  12. If breadth-first search first discovers node T at edge distance 3, what is the shortest distance to T?

    • 4 edges
    • 2 edges
    • 1 edge
    • 3 edges
  13. Breadth-first search starts at S. S has neighbours X and Y, and X has neighbour Z. After S and then X are processed, which nodes are in the queue?

    • X and Y
    • S, X, Y and Z
    • Y and Z
    • Z only
  14. A depth-first search uses an explicit stack. S has neighbours X then Y pushed in that order. Which node is popped next?

    • X
    • Z
    • Y
    • S
  15. How many total nodes will a complete breadth-first search visit in a connected graph with 10 nodes?

    • 5
    • 10
    • 9
    • 1
  16. What structure in a graph makes tracking visited nodes necessary to prevent infinite loops?

    • Tree
    • Cycle
    • Leaf node
    • Edge weight
  17. What is the time complexity of breadth-first or depth-first search on a graph with V vertices and E edges, using adjacency lists?

    • O(V^2)
    • O(E log V) always
    • O(V + E)
    • O(2^V)
  18. Which search algorithm uses a queue to hold nodes waiting to be visited?

    • Depth-first search
    • Binary search
    • Linear search
    • Breadth-first search
  19. A search starts in a connected component with 4 nodes. How many nodes can it visit?

    • 0
    • 2
    • 6
    • 4
  20. Which algorithm finds the shortest path in a graph with positive edge weights?

    • Linear search
    • Dijkstra's algorithm
    • Depth-first search
    • Breadth-first search

All AQA Computer Science quizzes