Question: Question 1 (10 points) Saved Using the Big O notation, estimate the time complexity of the code below. Briefly explain how you derive your answer.

Question 1 (10 points)

Saved

Using the Big O notation, estimate the time complexity of the code below. Briefly explain how you derive your answer.

int count = 1; while (count < n) { count = count * 2; }

Question 2 (10 points)

Using the Big O notation, estimate the time complexity of the code below. Briefly explain how you derive your answer.

int count = 10; while (count < n) { count = count * 3; }

Question 3 (10 points)

Using the Big O notation, estimate the time complexity of the code below. Briefly explain how you derive your answer.

for (int i=0; i System.out.print("*"); if (i%10 == 0) { System.out.println(); } } System.out.println();

Question 4

Using the Big O notation, estimate the time complexity of the code below. Briefly explain how you derive your answer.

for (int i=0; i System.out.print("*"); } }

Question 5

Using the Big O notation, estimate the time complexity of the code below. Briefly explain how you derive your answer.

for (int i=0; i System.out.print("*"); } }

Question 6

Using the Big O notation, estimate the time complexity of the code below. Briefly explain how you derive your answer.

for (int i=0; i System.out.print("*"); } }

Question 7

Using the Big O notation, estimate the time complexity of the code below. Briefly explain how you derive your answer.

for (int i=0; i for (int k=0; k } } }

Question 8

Using the Big O notation, estimate the time complexity of the code below. Briefly explain how you derive your answer.

for (int i=0; i<10; i++) { for (int j=0; j for (int k=0; k } } }

Question 9

Using the Big O notation, estimate the time complexity of the code below. Briefly explain how you derive your answer.

public static void printArray(int[] m) { for (int i=0; i < m.length; i++) { System.out.print(m[i]); } for (int i=m.length-1; i>=0; i--) { System.out.print(m[i]); } }

Question 10

Using the Big O notation, estimate the time complexity of the code below. Briefly explain how you derive your answer.

public static void printArray2 (int[] m) { for (int i=0; i < m.length; i++) { for (int j=0; j < i; j++) { System.out.print(m[i] * m[j]); } } }

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!