TCS
Company
Programming
Technical
Q. Minimum number of leaf nodes in a binary search tree of n nodes
Read Solution (Total 19)
-
- (n+1)/2
ex:if n=3, then leaf nodes=(3+1)/2=2
- 10 years agoHelpfull: Yes(7) No(0)
Binary tree Must Contain Exactly 2 childrens So Minimun Number of Leaf Nodes in a Binary Tree Will be 2- 10 years agoHelpfull: Yes(4) No(5)
- answer is 1
- 10 years agoHelpfull: Yes(4) No(1)
- Please give correct explanations...multiple answers will give confusion
- 10 years agoHelpfull: Yes(3) No(0)
- k=no. of level in binary tree.
n=2^k-1
2^k=n+1
no of leaf nodes=2^(k-1)=2^k/2=(n+1)/2 - 10 years agoHelpfull: Yes(3) No(0)
- 1
as for n nodes=>minimum nodes in the last level is 1 - 11 years agoHelpfull: Yes(2) No(2)
- ans is n-1
- 11 years agoHelpfull: Yes(2) No(5)
- n=h+1
where h=height of the tree.
if h=0, i.e if the node is at 0th level, then there will be only one node and that will be the child node.
so, minimum number of leaf node(s) in a binary search tree of n nodes = 1 - 10 years agoHelpfull: Yes(2) No(0)
- n-1 nodes
- 10 years agoHelpfull: Yes(0) No(2)
- n-1 for binary search tree
- 10 years agoHelpfull: Yes(0) No(2)
- (2^n)-1) n is the hight of tree for n=1 there is only one node that is 2^0=1 similarly for n=3 there is no. of node is 7 that is (2^3)-1)=7
- 10 years agoHelpfull: Yes(0) No(1)
- (n+1)/2 nodes
- 10 years agoHelpfull: Yes(0) No(1)
- IF A LEAF NODES THEN A-1 NON LEAF NODES SO.A+A-1=N,A=N+1/2 IS THE ANSWER....
- 10 years agoHelpfull: Yes(0) No(1)
- n+1, for 1 node der will be 2 leaf nodes, similarly, for 3 nodes(ie 1root+2children)der will be 4 leaf nodes...
- 10 years agoHelpfull: Yes(0) No(1)
- 2^N;
there will be two child nodes for every parent node.At root level 1 i.e. 2^0 , then 2 i.e. 2^1 then 4 i.e. 2^2 and so on next levels... - 10 years agoHelpfull: Yes(0) No(0)
- (2^n-1)nodes
- 10 years agoHelpfull: Yes(0) No(0)
- the binary tree contains two child nodes
so,the binary tree contains 2 leaf nodes
- 10 years agoHelpfull: Yes(0) No(0)
- minimum no of leaf node is n-1
- 5 years agoHelpfull: Yes(0) No(0)
- Assuming that for λ=k we have a minimum of N=2k+1 nodes, if we add a node, it must branch from one of the leaves. But in order to maintain a full binary tree, we must add an additional node; that is, adding an additional levels requires at minimum two more nodes. So, we will have N+2 nodes.
- 5 years agoHelpfull: Yes(0) No(0)
TCS Other Question