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.
The 20 questions
-
Which graph traversal algorithm guarantees finding the shortest path in an unweighted graph?
- Binary search
- Breadth-first search
- Linear search
- Depth-first search
-
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
-
Which primary data structure is used to track unexplored nodes in depth-first search?
- Array
- Queue
- Priority queue
- Stack
-
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
-
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
-
Which search goes as deep as possible along one path before backtracking?
- Binary search
- Linear search
- Depth-first search
- Breadth-first search
-
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
-
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
-
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
-
In the same graph, what is the shortest number of edges from A to E?
- 1
- 4
- 3
- 2
-
What technique does depth-first search perform when reaching a dead end in a maze?
- Level traversal
- Linear looping
- Shortest pathing
- Backtracking
-
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
-
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
-
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
-
How many total nodes will a complete breadth-first search visit in a connected graph with 10 nodes?
- 5
- 10
- 9
- 1
-
What structure in a graph makes tracking visited nodes necessary to prevent infinite loops?
- Tree
- Cycle
- Leaf node
- Edge weight
-
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)
-
Which search algorithm uses a queue to hold nodes waiting to be visited?
- Depth-first search
- Binary search
- Linear search
- Breadth-first search
-
A search starts in a connected component with 4 nodes. How many nodes can it visit?
- 0
- 2
- 6
- 4
-
Which algorithm finds the shortest path in a graph with positive edge weights?
- Linear search
- Dijkstra's algorithm
- Depth-first search
- Breadth-first search
Related quizzes
- Pre-order, post-order and in-order traversal Quiz · 4.3.2.1 · 20 questions
- Infix to Reverse Polish notation Quiz · 4.3.3.1 · 20 questions
- Linear and binary search Quiz · 4.3.4.1 · 20 questions
- Binary tree search Quiz · 4.3.4.3 · 20 questions
- Bubble sort Quiz · 4.3.5.1 · 20 questions
- Merge sort Quiz · 4.3.5.2 · 20 questions
- Dijkstra's shortest path algorithm Quiz · 4.3.6.1 · 20 questions
- Data types Quiz · 4.1.1.1 · 20 questions
- Entity relationship modelling Quiz · 4.10.1.1 · 20 questions
- Big Data Quiz · 4.11.1.1 · 20 questions