Question: WHICH ONE IS THE CORRECT ANSWER Question 1 What is the time efficiency of the following code in Big O notation where myArray is a

WHICH ONE IS THE CORRECT ANSWER

Question 1

What is the time efficiency of the following code in Big O notation where myArray is a 2 dimensional integer array of size [N][M]:

for (int i = 0; i

System.out.print(myArray[i][0]);

}

Question 1 options:

O(N*N), or N squared

O(1), or constant-time

O(N*M)

O(N)

Question 2

What is the time efficiency of the following code in Big O notation where myArray is a 2 dimensional integer array of size [N][M]:

for (int i = 0; i

for(int j = 0; j

System.out.print(myArray[i][j]);

}

}

Question 2 options:

O(1), or constant time

O(N)

O(N*M)

O(N*N), or N squared

Question 3

What is the time efficiency of the following code in Big O notation where myArray is a 2 dimensional integer array of size [N][M]:

for (int i = 0; i

System.out.println(myArray[i][0]);

}

for (int i = 0; i

System.out.println(myArray[0][i]);

}

Question 3 options:

O(M+N)

O(N*N), or N squared

O(M*M), or M squared

O(N*M)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!