Add to Chrome
✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
What is the time complexity of the following?
void f(int n)
{
if (n>0)
for(int i=1;i<n;i=i*2)
cout<<n;
f(n-1);
}
Θ( n log n)
Θ( log n)
Θ( n2 )
Θ( n )
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!