The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
0 votes
What is the time complexity of the following recurrence relation and step to derive the same

$T(n) = T(\sqrt{n}) + log(logn)$
closed with the note: Query resolved.
asked in Algorithms by (239 points)
closed by | 135 views

1 Answer

+2 votes
Take $n=2^m$ then

$T(2^m)=T(2^{m/2})+\log m$

$\implies S(m)=S(m/2)+\log m$

Solve using master's theorem .$S(m)=O(\log ^2 m)=T(2^m)$

Put $m=logn \implies T(n)=(\log \log n)^2$
answered by Loyal (7.3k points)
How did you derive the 3rd step, m = $2^{m}$ is understod but how $2^{m/2}$ written as m/2
We are not replacing $2^m \;by\; m$  but we are changing function T to S.

$T(2^m)\implies$  function of m.    (S(m))

$T(2^{m/2})\implies$  function of m/2.    (S(m/2))

Related questions

+6 votes
1 answer
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
49,539 questions
54,105 answers
71,017 users