मैं द्विआधारी खोज के पेड़ के बारे में पढ़ा है कि अगर यह एक पूरा पेड़ है (पत्र-गांठ को छोड़कर सभी नोड्स दो बच्चे हैं) n नोड्स होने, तो कोई पथ 1 से अधिक + लॉग इन करें n नोड्स हो सकता है।
यहाँ गणना मैंने किया है ... तुम मुझे दिखा, जहां मैं गलती कर दी कर सकते हैं ....
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)
तो फिर कैसे नंबर 1 + n आने लॉग था ...?













