subject

Consider the following two loops: // Loop A for (i = 1; i <= n; i++) for (j = 1; j <= 10000; j++) sum = sum + j; // Loop B for (i = 1; i <= n; i++) for (j = 1; j <= n; j++) sum = sum + j; Although Loop A is O(n) and Loop B is O(n2), Loop B can be faster than Loop A for small values of n. Design and implement an experiment to find a value of n for which Loop B is faster.

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 15:30, alexdub9649
What is a costume plot? why is it important to a film or theater production?
Answers: 2
image
Computers and Technology, 23.06.2019 00:30, lm18618
Which one of the following is considered a peripheral? a software b mouse c usb connector d motherboard
Answers: 2
image
Computers and Technology, 24.06.2019 11:00, iloveballet1857
Each row in a database is a set of unique information called a(n) ? a.) table. b.) record. c.) object. d.) field.
Answers: 2
image
Computers and Technology, 24.06.2019 13:00, ddaaaeeee2960
Which one of the following functions is not available on the autosum tool? sum average if max
Answers: 3
You know the right answer?
Consider the following two loops: // Loop A for (i = 1; i <= n; i++) for (j = 1; j <= 10000; j...

Questions in other subjects:

Konu
Chemistry, 06.07.2019 15:40