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; 

}

The post i-m-having-trouble-with-understanding-the-concept-of-time-complexity-and-big-o-e appeared first on Academic Works Help.

Our writing company helps you enjoy campus life. We have committed and experienced tutors and academic writers who have a keen eye in writing papers related to Business, Management, Marketing, History, English, Media studies, Literature, nursing, Finance, Medicine, Archaeology, Accounting, Statistics, Technology, Arts, Religion, Economics, Law, Psychology, Biology, Philosophy, Sociology, Political science, Mathematics, Engineering, Ecology etc.

Need Custom Written Paper?

-Plagiarism free

-Timely delivery