Search Header Logo

Algorithm Time Complexity Quiz

Authored by Soham Soham

Other

University

Used 1+ times

Algorithm Time Complexity Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which notation is used to represent the upper bound of an algorithm's time complexity?

Θ (Theta)

Ω (Omega)

O (Big-O)

Σ (Sigma)

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which time complexity represents a constant-time algorithm?

O(n)

O(n log n)

O(1)

O(n²)

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the worst-case time complexity of linear search?

O(n)

O(n²)

O(log n)

O(n log n)

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If an algorithm has time complexity O(2ⁿ), how does its execution time grow as input size increases?

Linearly

Logarithmically

Exponentially

Constant

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If a nested loop runs n times in the outer loop and n times in the inner loop, what is the time complexity?

O(1)

O(n)

O(n²)

O(log n)

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct way to declare an integer array of size 5 in C++?

int arr[5];

array arr[5];

int arr();

int arr{};

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you assign the value 10 to the first element of an array arr in C++?

arr[0] = 10;

arr = {10};

arr[1] == 10;

arr(0) = 10;

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?