Home »
MCQs »
Discrete Mathematics MCQs
Discrete Mathematics | Binary Search Trees MCQs
Discrete Mathematics | Binary Search Trees MCQs: This section contains multiple-choice questions and answers on Binary Search Trees in Discrete Mathematics.
Submitted by Anushree Goswami, on October 23, 2022
1. Unlike binary search trees, binary search trees contain ____ values at the left and smaller values at the right?
- Larger
- Smaller
- Equal
- None
Answer: A) Larger
Explanation:
Unlike binary search trees, binary search trees contain larger values at the left and smaller values at the right.
2. Binary search trees do not have to refer to nodes whose value immediately ____ and follows it?
- Exceeds
- Precedes
- Changes
- Adds
Answer: B) Precedes
Explanation:
Binary search trees do not have to refer to nodes whose value immediately precedes and follows it.
3. Which of the following statement is TRUE to insert into a Binary Search Tree?
- Identify the root node by comparing the ITEM with it.
- In the event that ITEM>ROOT NODE, move to the right child, which becomes the root node for the right subtree.
- If ITEM<ROOT NODE is present, proceed to the left child.
- All of the above
Answer: D) All of the above
Explanation:
The following statements are TRUE to insert into a bInary Search Tree -
- Identify the root node by comparing the ITEM with it.
- In the event that ITEM>ROOT NODE, move to the right child, which becomes the root node for the right subtree.
- If ITEM<ROOT NODE is present, proceed to the left child.
4. The ITEM is inserted as the ____ child of the node if its value is greater than the node, and as the ____ child if its value is less than the node?
- Right, Left
- Left, Right
- Right, Root
- Root, Left
Answer: A) Right, Left
Explanation:
The ITEM is inserted as the right child of the node if its value is greater than the node, and as the left child if its value is less than the node.
5. Depending on the number of children of the deleted node, there are ____ ways to delete an ITEM from a binary search tree?
- Two
- Three
- Four
- Multiple
Answer: B) Three
Explanation:
Depending on the number of children of the deleted node, there are three ways to delete an ITEM from a binary search tree.
6. Which is the correct way to delete an ITEM from a binary search tree?
- Deleted Node has no children
- Deleted Node has Only one child
- Deletion node has only two children
- All of the above
Answer: D) All of the above
Explanation:
The correct way to delete an ITEM from a binary search tree is-
- Deleted Node has no children
- Deleted Node has Only one child
- Deletion node has only two children
7. Nodes with no children can be deleted by replacing them with ___, which is very simple to do?
- Nodes
- Null
- Endpoints
- Edges
Answer: B) Null
Explanation:
Nodes with no children can be deleted by replacing them with null, which is very simple to do.
8. Replace the deleted node with the node whose value is ____to that of the deleted node if the deletion node only has two children?
- Farthest
- Behind
- Closest
- Infinite
Answer: C) Closest
Explanation:
Replace the deleted node with the node whose value is closest to that of the deleted node if the deletion node only has two children.
9. Our goal is to find the nearest value, so we move left first, then right as far as possible. The node nearest to us is called the ____?
- Farthest Predecessor
- Nearest Predecessor
- Closest Predecessor
- Immediate Predecessor
Answer: D) Immediate Predecessor
Explanation:
Our goal is to find the nearest value, so we move left first, then right as far as possible. The node nearest to us is called the immediate predecessor.
10. The ____element of the root node should be replaced with the root node to delete it?
- Farthest
- Infinite
- Closest
- None
Answer: C) Closest
Explanation:
The closest element of the root node should be replaced with the root node to delete it.