retagged by
2,115 views
1 votes
1 votes
Consider the following function
find (int n)
{
if (n < 2 ) then return;
else
{
sum= 0;
for (i= 1; i ≤ 4; i++)

find (n/2);
for (i=1; i≤ n*n; i++)
sum= sum + 1;
}
}
Assume that the division operation takes constant time and “sum” is global variable. What is the time complexity of “find (n)” ?
retagged by

1 Answer

Related questions

0 votes
0 votes
3 answers
2
Nisha Bharti asked Sep 26, 2022
728 views
What is the time & space complexity of this algorithm?Main(){ for(i=n; i>10; i=i^1/4) { for(j=201; j<n^3; j=j+400) ...
0 votes
0 votes
1 answer
3
tusharb asked Feb 18, 2022
691 views
As we know the time complexity of solving the greedy knapsack algorithm depends mainly on the sorting algorithm used, Can we use counting sort as the sorting algorithm to...
2 votes
2 votes
1 answer
4
samarpita asked Dec 29, 2021
629 views
how to solve this?