• closed by
728 views
0 0 votes
closed with the note: got the answer.
What is the time complexity of the following piece of code in the terms of n?

$Main()$
{
$n=2^{2^k};$
$for(i=1; i<=n; i++)$
{
     $j=2;$
    $while(j<=n)$
   {
     $j=j^2;$
   }
}
}
Position:
Show:

Related questions

2 2 votes
0 0 answers
1.1k
1.1k views
junaid ahmad asked Jan 22, 2018
1,120 views
void fun(intn) { int s=0; for(i=1;i<=n;i++) { for(j=1;j<=i*i;j++) { if(j%i==0) { for(k=1;k<=j;K++) s++ } } } }
5 5 votes
1 answers 1 answer
1.5k
1.5k views
rahul sharma 5 asked Oct 18, 2017
1,539 views
T(n) = 4T(n/2) + n2.$\sqrt{2}$In thetha notation?
1 1 vote
2 answers 2 answers
1.7k
1.7k views
rahul sharma 5 asked Dec 16, 2016
1,651 views
for(i=1 to n) { if(n mod i==0) { for(int j=1 to n) printf(j); } }
0 0 votes
1 1 answer
1.5k
1.5k views
gate_forum asked Dec 25, 2015
1,508 views
minimum running time of algo that determines universal sink in a directed graph G={V,E} - a vertex with indegree |V|-1 and outdegree 0, given an adjacency matrix for G is...