Search Header Logo

Big O Quiz: Test Your Understanding

Authored by mins mins

Other

12th Grade

Used 3+ times

Big O Quiz: Test Your Understanding
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

33 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the time complexity of inserting a new element at the beginning of a linked list?

a) O(1)

b) O(log n)

c) O(n)

d) O(n log n)

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

15. Consider the following Java code snippet:

      for (int i = 0; i < n; i++) { // Do something in constant time

}

for (int i = 0; i < n; i++) {

  for (int j = 0; j < i; j++) { // Do something in constant time

  }

}

   

What is the time complexity of this code?

a) O(n)

b) O(n^2)

c) O(n log n)

d) O(n^3)

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the time complexity of finding the median of an unsorted array?

a) O(1)

b) O(n)

c) O(n log n)

d) O(n^2)

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the time complexity of finding the mode of a sorted array?

a) O(1)

b) O(n)

c) O(n log n)

d) O(n^2)

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the time complexity of sorting an array using quick sort in the worst case?

a) O(n)

b) O(n log n)

c) O(n^2)

d) O(n^3)

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the time complexity of sorting an array using heap sort?

a) O(n)

b) O(n log n)

c) O(n^2)

d) O(n^3)

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the time complexity of the remove(index) operation in an ArrayList?

A. O(n)

B. O(1)

C. O(log n)

D. O(n^2)

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?