I M Having Trouble With Understanding The Concept Of Time Complexity And Big O E

Urgent please help. I’m having trouble with understanding the concept of time complexity and big-o estimate.. For the following parts, try to get the best Big-O estimate and briefly justify your answers. programming c language.

Part a) (nested loop)

int i, j;

int n = 100;

for (i = 1; i <= n; i++) {

for (j = 3*i; j <= n; j++) {

printf(“programming is funn”);

}

}

(Is this one O(n^2)?

Part b)(nested loop)

int i, j;

int n = 1000000;

for (i = 1; i <= n; i++) {

for (j = 1; j <= 10000; j++) {

printf(“%d %dn”, i, j); 

}

}

(is this one O(N)?

Part c)(nested loop)

int i = 0;

int n = 10;

int j;

while (i < n) {

i++;

j = i;

while (i < n) {

printf(“hello %dn”, i);

i++;

}

i = j; 

}

Part d)(nested loop)

int i = 0;

int n = 10;

int j;

while (i < n) {

i++;

j = i;

while (i < n) {

printf(“hello %dn”, i);

i++;

break;

}

i = j; 

}

Need your ASSIGNMENT done? Use our paper writing service to score good grades and meet your deadlines.


Order a Similar Paper Order a Different Paper