Multiple Choice Questions On Tree Data Structures | letsbug
MCQs On Tree Data - Structure
1. Children of same parent are called _____.
- Node
- Child Node
- Sibling
- None of these
Answer: 3 : Sibling
2. The number of edges from the node to the deepest leaf is called _____ of the tree.
- Height
- Depth
- Length
- Width
Answer: 1 : Height
3. The number of edges from the root to the node is called ______ of the tree.
- height
- Depth
- Length
- Width
Answer: 2 : Depth
4. Consider the following tree:
1
/ \
2 3
/ \ / \
4 5 6 7
5. If the postorder traversal gives (ab - cd *+) then the label of the nodes 1, 2, 3, 4, 5, 6 will be _______.
- +, -, *, a, b, c
- a, -, b, +, c, *, d
- a, b, c, d, -, *, +
- -, a, b, +, *, c, d
Answer: 3 : a, b, c, d, -, *, +
6. The indegree of ______ of a tree is always zero.
- any node
- a branch node
- the root node
- a leaf node
Answer: 4 : a leaf node
7. A list of integers is read in, one at a time and a binary search tree is constructed. Next the tree is traversed and the integers are printed. Which traversal would print result in the original order of input?
- preorder
- postorder
- inorder
- none of the above
Answer: 2 : postorder
8. A binary tree T has n leaf nodes. The number of nodes of degree 2 in T is _____.
- log 2 n
- n - 1
- n
- 2 ^ n
Answer: 2 : n - 1
9. A binary tree in which every non-leaf node has non-empty left and right subtree is called strictly binary tree. Such a tree with 10 leaves _____.
- cannot have more than 1 nodes
- has exactly 19 nodes
- has exactly 17 nodes
- cannot have more than 17 nodes
Answer: 1 : cannot have more than 1 nodes
10. The depth of complete binary tree with n nodes is _______.
- log 2 (n + 1) - 1
- log 2 n
- log 2 (n - 1 ) + 1
- log 2 n + 1
Answer: 4 : log 2 n + 1
11. The number of binary tree with 2 nodes which when traversed in postorder gives the sequence A, B, X is
- 3
- 9
- 7
- 5
There are different equipment and chemicals that are present in any research lab. The devices are necessary in order to conduct different essential experiments. A chemistry lab cannot function effectively Buy MDMA without lab equipment as it would not be possible to undertake the required experiments.
ReplyDelete