Lesson 4.2.5.1
4.2.5.1 Trees and binary trees Quiz: AQA Computer Science, Unit 2
20 questions
In partnership with Revision Ninja
Lesson 4.2.5.1, Trees and binary trees: 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.
The 20 questions
-
What is a tree in graph terms?
- A directed graph with two cycles
- A connected, undirected graph with no cycles
- A graph with no vertices
- A graph in which every vertex has exactly two edges
-
What is a rooted tree?
- A tree with no edges
- A tree in which one vertex is designated as the root
- A tree in which every node has exactly three children
- A tree that contains a cycle
-
In a rooted tree, which node has no parent?
- Every node
- A leaf
- The root
- Any internal node
-
What is a binary tree?
- A tree in which every node has exactly four children
- A list of key-value pairs
- A graph with two cycles
- A rooted tree in which each node has at most two children
-
A tree has 9 nodes, with one root and every other node having exactly one parent. How many edges does it have?
- 7
- 8
- 9
- 10
-
A binary search tree is used to store the values 8, 3, 10. Where is the value 3 placed relative to 8?
- In a separate tree
- In the left subtree of 8
- As the root's parent
- In the right subtree of 8
-
Which order of traversal of a binary search tree visits the values in ascending order?
- In-order traversal
- Post-order traversal
- Level-order traversal of a queue only
- Pre-order traversal
-
A leaf node in a tree is best described as which of these?
- The root of the tree
- A node with exactly two parents
- A node with no children
- A node that is a cycle
-
Which is a typical use of a rooted tree?
- Storing a queue of print jobs in arrival order
- Representing a file system's folder hierarchy
- Counting bytes in a binary file
- Showing a single linear list of numbers
-
A binary tree has a root with two children and each child has none. What is the height of this tree if the height counts levels?
- 2
- 1
- 3
- 0
-
Which statement about trees is correct?
- A tree does not have to have a root in the general definition
- A tree must always contain a cycle, which is what separates it from a list of connected nodes
- A tree always has exactly two children per node, so every node has the same number of links
- A tree is always directed with one edge per node, joining each node to its single parent
-
A binary search tree is built by inserting 5, 2, 8, 1. Which node is the right child of 2?
- 1, which is the right child of 2 because 1 is the last value that was inserted into the tree
- 8, which is the right child of 2 because 8 is larger than 5 and is placed beneath the root
- 5, which is the right child of 2 because the root is always the right child of its own children
- None; 1 is the left child and no right child exists
-
What is the difference between a parent and a child in a rooted tree?
- There is no difference
- A parent is the node directly above, and a child is directly below it
- A child is above its parent
- A parent is always a leaf, and a child is always the root
-
A complete binary search tree with 7 nodes has how many levels?
- 2
- 3
- 7
- 4
-
Which description best fits a binary tree node?
- A value plus references to a parent and a queue
- A key with a list of weights
- A single integer with no references
- A value plus references to at most two child nodes
-
A graph with a cycle is being checked to see whether it is a tree. What is the result?
- It is a rooted tree only if the cycle is removed by a root
- The test cannot be performed on graphs
- It is not a tree, because trees have no cycles
- It is a tree because it has a cycle
-
A tree with 15 nodes is a full binary tree with all levels filled. How many levels does it have?
- 5
- 3
- 4
- 15
-
Why is a binary search tree efficient for searching when it is balanced?
- Each comparison discards about half of the remaining nodes
- It searches all nodes in order each time, which makes each lookup take as long as the whole tree
- It stores every value in a single list, so each search reads the values from start to end
- It requires no comparisons at all, since the position of each value is known from its size
-
Which term describes the nodes of a tree that have at least one child?
- Leaves, which are nodes at the bottom of the tree with no children below them
- Internal nodes
- Keys, which are the values used to order the nodes and find them within the tree
- Edges, which are the links that join each node to the nodes that sit beneath it
-
What does it mean for a binary tree node to have a left child but no right child?
- The node is a leaf, which means it has no children at all, neither on the left nor the right
- The node has one child, which is the left one
- The node is the root of the tree, with no parent and with a single child on its left side
- The node has two children, one on the left and one on the right, both below it in the tree
Related quizzes
- Data structures and abstract data types Quiz · 4.2.1.1 · 20 questions
- Single- and multi-dimensional arrays Quiz · 4.2.1.2 · 20 questions
- Reading and writing text and binary files Quiz · 4.2.1.3 · 20 questions
- Linear, circular and priority queues Quiz · 4.2.2.1 · 20 questions
- Stack operations Quiz · 4.2.3.1 · 20 questions
- Graphs: weighted, directed and adjacency representations Quiz · 4.2.4.1 · 20 questions
- Hash tables, hashing and collisions Quiz · 4.2.6.1 · 20 questions
- Dictionaries and key-value pairs Quiz · 4.2.7.1 · 20 questions
- Vectors and vector operations Quiz · 4.2.8.1 · 20 questions
- Data types Quiz · 4.1.1.1 · 20 questions