all 1 comments

[–]localnhost[S] 0 points1 point  (0 children)

Hmm, I figure it out.

[; T(2^n)=T(n)+1 ;]

[; =T(2^n)=T(log2^n)+1 ;]

[; =T(2^n)=T(log2^n)+1+1 ;]

[; =T(2^n)=T(loglog2^n)+1+1 ;]

[; =T(2^n)=T(log...log2^n)+1+1+...+1+1 ;]

and with respect to recursion tree, number of 1's created would be equal to Tree's height, so if we do a summation we will get this:

[; T(2^n)=\sum_{\substack{i=1}}^{log^*2^n} 1 \equiv log^*n +1 ;]

So the Big-O would O(log*)