Which of the following is a true about Binary Treesa)Every binary tree...
A full binary tree (sometimes proper binary tree or 2-tree or strictly binary tree) is a tree in which every node other than the leaves has two children. A complete binary tree is a binary tree in which every level, except possibly the last, is completely filled, and all nodes are as far left as possible. A) is incorrect. For example, the following Binary tree is neither complete nor full
B) is incorrect. The following binary tree is complete but not full
C) is incorrect. Following Binary tree is full, but not complete
D) is incorrect. Following Binary tree is both complete and full
View all questions of this test
Which of the following is a true about Binary Treesa)Every binary tree...
Explanation:
Binary trees are the trees in which each node can have at most two children. Here are the statements given in the question and their explanations:
a) Every binary tree is either complete or full.
This statement is false. There are binary trees which are neither complete nor full. For example, consider a binary tree in which each node has only one child. Such a binary tree is neither complete nor full.
b) Every complete binary tree is also a full binary tree.
This statement is false. A complete binary tree is the one in which all levels except the last level are completely filled, and all nodes are as far left as possible. A full binary tree is the one in which every node has either 0 or 2 children. Consider the following binary tree:
```
1
/ \
2 3
/ \
4 5
```
This binary tree is complete but not full because node 2 has only one child.
c) Every full binary tree is also a complete binary tree.
This statement is true. A full binary tree is the one in which every node has either 0 or 2 children. Such a binary tree is always complete because all levels except the last level are completely filled. In the last level, all nodes are as far left as possible.
d) No binary tree is both complete and full.
This statement is false. Consider a binary tree with only one node. Such a binary tree is both complete and full.
e) None of the above.
This statement is true because statements a, b, and d are false, and statement c is true.