recategorized by
14,115 views
3 votes
3 votes

Suppose you are given a binary tree with n nodes, such that each node has exactly eiter zero or two children. The maximum height of the tree will be

  1. $\frac{n}{2}-1$
  2. $\frac{n}{2}+1$
  3. $(n-1)/2$
  4. $(n+1)/2$
recategorized by

3 Answers

Best answer
5 votes
5 votes
Question is about full binary tree..

If it is left or right biased than gives the maximum height...

Maximum height is( n-1/ 2) taking root at height 0.
selected by
2 votes
2 votes
Given Tree is a strictly binary tree, having either 0 or 2 children

such trees always contains odd number of nodes

if n=5, then max height will be 2 which is (n-1)/2

if n=7, then max height will be 3 which is again (n-1)/2

So, answer is C
Answer:

Related questions

3 votes
3 votes
2 answers
1
go_editor asked Aug 16, 2016
3,701 views
Which of the following is not an inherent application of stack?Implementation of recursionEvaluation of a postfix expressionJob schedulingReverse a string
4 votes
4 votes
1 answer
2
7 votes
7 votes
1 answer
3
go_editor asked Aug 14, 2016
5,264 views
A clique in a simple undirected graph is a complete subgraph that is not contained in any larger complete subgraph. How many cliques are there in a graph shown below?2456...
3 votes
3 votes
2 answers
4
go_editor asked Aug 14, 2016
5,469 views
The number of different spanning trees in complete graph, $K_4$ and bipartite graph, $K_{2,2}$ have ____ and ___ respectively.14, 1416, 1416, 414, 4