01-04-2012, 10:25 PM
depth of binary search tree d=log2(n+1) - 1 if n = 1000000 how answer is 20 ?because my answer is 5.
If we solve the expression
d = log2 (n+1) where n = 1000000
so
d= log2(1000001)
Now the way of finding log 2 . First we find log base 10 of 1000001, then we divide the answer with log base 10 (2).
log10 (1000001) = 6.000000
log 10(2) = .3010
log 2 (1000001) = 6.00000/.3010 = 19.93 which approximately equal to 20.
If we solve the expression
d = log2 (n+1) where n = 1000000
so
d= log2(1000001)
Now the way of finding log 2 . First we find log base 10 of 1000001, then we divide the answer with log base 10 (2).
log10 (1000001) = 6.000000
log 10(2) = .3010
log 2 (1000001) = 6.00000/.3010 = 19.93 which approximately equal to 20.
0300-9520262
Get solution in 24 hour |cpmputer & internet
mileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
