recategorized by
3,707 views
1 votes
1 votes

A complete $n$-ary tree is a tree in which each node has $n$ children or no children. Let $I$ be the number of internal nodes and $L$ be the number of leaves in a complete $n$-ary tree. If $L=41$, and $I=10$, what is the value of $n$?

  1. $3$
  2. $4$
  3. $5$
  4. $6$
recategorized by

3 Answers

1 votes
1 votes
For strict n-ary trees the relationship between external(leaf) nodes and internal nodes is: $$L = (n-1)i + 1$$

Using this formula, L = $41$ , i = $10$

$$41 = (n-1)*10 + 1$$

$$n = 5$$
Answer:

Related questions

3 votes
3 votes
3 answers
1
go_editor asked Nov 20, 2020
1,172 views
In a binary max heap containing $n$ numbers, the smallest element can be found in ______$O(n)$$O(\log _2 n)$$O(1)$$O(\log_2 \log_2 n)$
1 votes
1 votes
2 answers
3
go_editor asked Nov 20, 2020
798 views
Match $\text{List I}$ with $\text{List II}$Let $R_1=\{(1,1), (2,2), (3,3)\}$ and $R_2=\{(1,1), (1,2), (1,3), (1,4)\}$$\begin{array}{llll} & \text{List I} & & \text{List I...
3 votes
3 votes
3 answers
4
go_editor asked Nov 20, 2020
3,440 views
The number of positive integers not exceeding $100$ that are either odd or the square of an integer is _______$63$$59$$55$$50$