What is the time complexity of the following program?

int N = 0, M = 10;
for (int x = 0; x <= M; x++ ) {
writeToDisk(""something"");
for (int y = 0; y <= N; y++ ) {
Math.random();
}
}
a. O(M*N)
b. O(N)
c. O(N^2)
d. O(M+N)


a. O(M*N)

Computer Science & Information Technology

You might also like to view...

The ____________ begins with the word while, followed by a Boolean expression that is enclosed in parentheses.

a. conditional statement b. logic mark c. while clause d. loop parameter

Computer Science & Information Technology

What is wrong with the following Do loop?

``` Dim index As Integer = 1 Do While index <> 9 lstBox.Items.Add("Hello") index += 1 Loop ``` (A) The test variable should not be changed inside a Do loop. (B) The test condition will never be true. (C) This is an infinite loop. (D) Nothing

Computer Science & Information Technology

A(n) ________ trendline add/sets a linear trendline with a two-period forecast for the designated chart series

Fill in the blank(s) with correct word

Computer Science & Information Technology

Small ________ provide visual cues about the value of a cell relative to other cells

Fill in the blank(s) with correct word

Computer Science & Information Technology