Graph and Tree Traversal (AQA A-Level Computer Science): Quizzes
📚Quizzes
Practise the questions
10 questions from this quiz
ShowHide
Practise the questions
10 questions from this quiz
Why are adjacency lists ideal for sparse graphs?
Why are adjacency lists ideal for sparse graphs?
Store only existing connections
In an adjacency matrix, what does a value of 1 indicate?
In an adjacency matrix, what does a value of 1 indicate?
An edge exists between two nodes
How does depth first traversal explore a graph?
How does depth first traversal explore a graph?
Far along each path before backtracking
What data structure does breadth first traversal use?
What data structure does breadth first traversal use?
Queue
What does breadth first traversal guarantee to find in unweighted graphs?
What does breadth first traversal guarantee to find in unweighted graphs?
The shortest path
What is the pattern for pre-order tree traversal?
What is the pattern for pre-order tree traversal?
Visit-Left-Right
What special property does in-order traversal have for binary search trees?
What special property does in-order traversal have for binary search trees?
Produces nodes in sorted order
When would you use post-order traversal?
When would you use post-order traversal?
Deleting nodes from a tree
What happens without a base case in recursion?
What happens without a base case in recursion?
Stack overflow error
How many children can each node have in a binary tree?
How many children can each node have in a binary tree?
At most two
