A binary tree is a collection of nodes in which each node “has at most two successors”.
Hence, the correct answer is option “D”.
Explanation of Solution
Binary tree:
- Binary tree is a hierarchical structure to represent the data. The element of the tree is called as a node or item.
- Here, the branches are used to connect the nodes.
- Each node may have zero, one, or two children.
- A node that does not have a superior node is called the root node.
- The root node is the starting node, and it is the ancestor for all other nodes in the tree.
- The set of children node in a binary tree form a subtree rooted at that node.
- A node that does not have a children is called as a leaf node or an end node.
Explanation for incorrect options:
Has no successor:
A binary tree may have zero, one, or two successor node. So, it cannot be predicted that a binary tree has no successor.
Hence, option “A” is wrong.
Has one successor:
A binary tree may have zero, one, or two successor node. So, it cannot be predicted that a binary tree has one successor.
Hence, option “B” is wrong.
Has exactly two successors:
A binary tree may have zero, one, or two successor node. So, it cannot be predicted that a binary tree has exactly two successors.
Hence, option “C” is wrong.
Want to see more full solutions like this?
Chapter 21 Solutions
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)