Am citit despre copaci binar de căutare că, dacă acesta este un arbore complet (toate nodurile cu excepția nodurilor frunză au doi copii) având n noduri, atunci nici o cale poate avea mai mult de 1 + log n noduri.
Iată calculul am făcut ... pot să-mi arăt unde am gresit ....
the first level of bst has only one node(i.e. the root)-->2^0
the second level have 2 nodes(the children of root)---->2^1
the third level has 2^3=8 nodes
.
.
the (x+1)th level has 2^x nodes
so the total number of nodes =n = 2^0 +2^1 +2^2 +...+2^x = 2^(x+1)-1
so, x=log(n+1)-1
now as it is a 'complete' tree...the longest path(which has most no of nodes)=x
and so the nodes experienced in this path is x+1= log(n+1)
Atunci cum a apărut numărul 1 + n log veni ...?













