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

asked in Algorithms by Boss (5.9k points)   | 114 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.7k 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 Junior (503 points)  


Top Users May 2017
  1. akash.dinkar12

    3302 Points

  2. pawan kumarln

    1776 Points

  3. Bikram

    1646 Points

  4. sh!va

    1640 Points

  5. Arjun

    1396 Points

  6. Devshree Dubey

    1272 Points

  7. Debashish Deka

    1142 Points

  8. Angkit

    1044 Points

  9. LeenSharma

    1000 Points

  10. Arunav Khare

    754 Points

Monthly Topper: Rs. 500 gift card
Top Users 2017 May 22 - 28
  1. Bikram

    732 Points

  2. Arnab Bhadra

    402 Points

  3. pawan kumarln

    402 Points

  4. bharti

    304 Points

  5. LeenSharma

    238 Points


22,823 questions
29,142 answers
65,209 comments
27,666 users