The number of leaf nodes in a full 4-ary rooted tree of n nodes is
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: D. (3n + 1) / 4
Explanation
In a full k-ary tree, every internal node has exactly k children, so if there are I internal nodes and L leaf nodes, the total number of edges equals kI; since any tree with n nodes has exactly n − 1 edges, kI = n − 1, giving I = (n − 1)/k. The number of leaves is then L = n − I = n − (n − 1)/k = ((k − 1)n + 1)/k. Substituting k = 4 gives L = (3n + 1)/4. So the number of leaf nodes is (3n + 1)/4.More Data Structures and Algorithms questions
- Which of the following statements maybe false for a decision problem X ∈ NP?
- A binary search tree is obtained by inserting the words "Mathematics", "Physics", "Geography", "Zoology", "Metrology", "Geology", "Psycholo…
- In open addressing, how are collisions typically resolved?
- What is the height of the binary search tree obtained by inserting the numbers 40, 60, 50, 37, 52, 15, 8, 22 in the given order
- Match the LIST-I with LIST-II. LIST-I (Data structure) LIST-II (Characteristics) A. Stack I. First-In-First-Out (FIFO) order B. Queue II. L…
- How will the following min-heap appear on inserting the key 32? Original min-heap (level order): 5, 10, 25, 30, 40, 50, 60, 70, 80, 90 (roo…