What is true about run time complexity of these 2 code snippets?
fun1(int n)
fun2(int n)
{
{
int i=1, s=1;
int i=1, s=1;
While (s <=n)
for (i =1;i*i <=n; i++)
{
{
i++;
cont++;
s=s+i;
}
printf("*');
}
}
}
A) fun10 runs in O(n) while fun20) runs in O(na)
B) Both fun 10 and fun20 run in linear time
C) Both fun 1() and fun20) run in O(sqrt(n))
D) None of these
Answers
Answered by
0
Answer:
first follow me and Mark me as brainliest then I'll answer your question
Similar questions
Political Science,
3 months ago
English,
3 months ago
History,
7 months ago
Hindi,
7 months ago
Physics,
11 months ago
Psychology,
11 months ago