GATE CSE
First time here? Checkout the FAQ!
x
+1 vote
105 views

asked in Algorithms by Boss (5.7k points)   | 105 views

2 Answers

+4 votes
Best answer

say n nodes are in binary tree.

1+2+3+4+...+i=n

   (i*(i+1)) / 2 = n

                i2=n

height is=O($\sqrt{n}$ )

 

answered by Veteran (22.4k points)  
selected by
0 votes
Total number of nodes n = 1 + 2 + 4 +... 2^(h-1) = 2^h - 1
n = 2^h - 1
h = lg (n+1)
h = O(lg n)
So A) is correct
answered by (485 points)  


Top Users Apr 2017
  1. akash.dinkar12

    3660 Points

  2. Divya Bharti

    2580 Points

  3. Deepthi_ts

    2040 Points

  4. rude

    1966 Points

  5. Tesla!

    1768 Points

  6. Debashish Deka

    1614 Points

  7. Shubham Sharma 2

    1610 Points

  8. Prashant.

    1492 Points

  9. Arjun

    1472 Points

  10. Arunav Khare

    1464 Points

Monthly Topper: Rs. 500 gift card

22,088 questions
28,063 answers
63,298 comments
24,173 users