Data Structures & Algorithms Multiple Choice Questions on “K-ary Tree – 1”.
1. How many child nodes does each node of K-ary Tree contain?
a) 2
b) 3
c) more than k
d) at most k
Answer: d
Clarification: Each node of K-ary tree contains at most k nodes. While tree with 2 nodes is called Binary tree and tree with 3 nodes is called Ternary tree.
2. Which of the following is the name of the node having child nodes?
a) Brother
b) Sister
c) Mother
d) Parent
Answer: d
Clarification: Parent node is the node having child nodes and child nodes may contain references to their parents. Parent node is a node connected by a directed edge to its child.
3. What is the depth of the root node of K-ary tree?
a) 2
b) 1
c) 0
d) 3
Answer: c
Clarification: Depth is defined as the length of the path from root to the node. So the depth of root node in K-ary tree is 0.
4. What is the Height of the root node of K-ary tree?
a) 1
b) 2
c) 3
d) 0
Answer: d
Clarification: Height of K-ary tree is defined as the length of path from root to deepest node in tree. Therefore, height of root node in K-ary tree is 0.