Algorithm Time Complexity Quiz

Algorithm Time Complexity Quiz

University

10 Qs

quiz-placeholder

Similar activities

Data Structure 1

Data Structure 1

University

10 Qs

DAA-UNIT III

DAA-UNIT III

University

10 Qs

Post-test array c++

Post-test array c++

University

10 Qs

AlgoWhiz Quiz

AlgoWhiz Quiz

University

15 Qs

Python Numpy and Pandas Quiz

Python Numpy and Pandas Quiz

University

15 Qs

Java Arrays

Java Arrays

5th Grade - University

10 Qs

C Programming First Quiz - Sec H

C Programming First Quiz - Sec H

University

10 Qs

Suprize Test - 6.10.2022

Suprize Test - 6.10.2022

University

10 Qs

Algorithm Time Complexity Quiz

Algorithm Time Complexity Quiz

Assessment

Quiz

Other

University

Medium

Created by

Soham Soham

Used 1+ times

FREE Resource

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;

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?