Question: Consider thTime complexity analysis 1 Consider the following algorithm and answer questions 4 and 5 : void myfun 1 ( int n ) { int

Consider thTime complexity analysis 1
Consider the following algorithm and answer questions 4 and 5 :
void myfun1(int n)
{
int i=0, count =0;
while (in)
i
i+=2;
for (int +j-2n(n)=#n12n2+12n
18n2+34n+2
2n2+2n
18n2+14n+1
12n2+n+1T(n)(n2)(1)(n2+1)(n)
(n2+n)j=0;j e following algorithm and answer questions 4 and 5:
void myfun1(int n)
{
int i =0, count =0;
while (i = n)
{
i +=2;
for (int j =0; j i; j +=2)
{
System.out.println(i +","+ j *2);
count++;
}
}
System.out.println(count);
}
 Consider thTime complexity analysis 1 Consider the following algorithm and answer

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!