• retagged by
1,291 views
2 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$

1 Answer

Best answer
3 3 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:
Position:
Show:

Related questions

0 0 votes
1 answers 1 answer
461
461 views
Bikram asked Nov 26, 2016
461 views
The following keys are inserted in an empty binary search tree (and height of the root of tree is $1$).Keys are: $11, 10, 1, 9, 7, 4, 3, 2, 6, 8, 5, 12$The height of the ...
3 3 votes
1 answers 1 answer
619
619 views
Bikram asked Nov 26, 2016
619 views
For inorder traversal of a BST, which of the following statements is TRUE?O/p is always in sorted decreasing order.O/p always in sorted increasing orderIt does not sort t...
1 1 vote
1 answers 1 answer
780
780 views
Bikram asked Nov 26, 2016
780 views
A binary tree has 10 nodes , the in-order and pre-order traversal of the tree isPre order: A B D E H J C F I GIn order - D B H J E A I F C GTotal number of leaf nodes i...
0 0 votes
1 1 answer
1.0k
1.0k views
Bikram asked Nov 26, 2016
1,010 views
Assume that we have a ternary tree in which each node can have at most $3$ children, namely left, middle and right. Consider the following function to calculate total num...