edited by
700 views
2 votes
2 votes

Let $T$ be a $N$-ary tree where each internal node of $T$ have at most $N$ children. Let the maximum depth of any node of $T$ be $m.$ What is the maximum number of leaves that $T$ can have when root at depth $0$?

  1. $N$
  2. $N * m$
  3. $N^m$
  4. $m^N$
edited by

1 Answer

Best answer
2 votes
2 votes
Let the tree T is 3 ary tree , means N = 3

Root None

  /      |      \         m = 0  => 3^0=1 node

1       2      3        m = 1  => 3^1=3 node

/ | \   / | \   / | \      m = 2  => 3^2=9 node

 

at depth m , maximum number of nodes 3^m , we can see from this picture.

so if m is the maximum depth of any node of tree T then maximum number of leaves N^m for a N ary tree.
selected by
Answer:

Related questions

0 votes
0 votes
1 answer
2
Bikram asked Nov 26, 2016
1,671 views
Three algorithms do the same task. Algorithm One is $O(N)$ and Algorithm Two is $O(\log N)$ and Algorithm Three is $O(N1/2)$. Which algorithm should execute the fastest f...
1 votes
1 votes
3 answers
3
0 votes
0 votes
0 answers
4