What is the complexity of the following code?

int i, j, k = 0;
for (i = n / 2; i <= n; i++) {
for (j = 2; j <= n; j = j * 2) {
k = k + n / 2;
}
}
a. O(nlog(n))
b. O(n)
c. O(n^2)
d. O(2^n)


a. O(nlog(n))

Computer Science & Information Technology

You might also like to view...

Create a directory called linux in your home directory. What command line did you use? What command would you use to create the directories called memos and personal in your home directory?

What will be an ideal response?

Computer Science & Information Technology

Which of the following is the command for saving the router's running configuration to nonvolatile memory? (Select one.)

A) copy run flash B) copy run start C) copy running flash D) copy start flash

Computer Science & Information Technology

The normal data bits per data word is 8 bits per word on a serial device

Indicate whether the statement is true or false

Computer Science & Information Technology

Find the slope.

A. slope
B. slope
C. slope
D. slope
E. slope

Computer Science & Information Technology