Algorithm Analysis and Design

Algorithm Analysis and Design

University

24 Qs

quiz-placeholder

Similar activities

C classroom activity 8.4.25

C classroom activity 8.4.25

University

20 Qs

EXAMEN 2DO PARCIAL 02_03

EXAMEN 2DO PARCIAL 02_03

University

20 Qs

Understanding Schematic and Logic Diagrams

Understanding Schematic and Logic Diagrams

University

20 Qs

Examen Unidad 2 Circuitos Eléctricos UTA

Examen Unidad 2 Circuitos Eléctricos UTA

University

19 Qs

Quiz 1

Quiz 1

University

19 Qs

Quiz Round For Group 1

Quiz Round For Group 1

University

20 Qs

Semiconductors and Diode Theory

Semiconductors and Diode Theory

University

20 Qs

Simulador SCRUM

Simulador SCRUM

University

20 Qs

Algorithm Analysis and Design

Algorithm Analysis and Design

Assessment

Quiz

Engineering

University

Practice Problem

Hard

Created by

EMMANUEL 210055

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

24 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 2 pts

If an algorithm has a loop that runs n times and performs O(1) operations in each iteration, what is the overall time complexity?

O(1)

O(n)

O(n²)

O(log n)

2.

MULTIPLE CHOICE QUESTION

20 sec • 2 pts

Consider the following code snippet:

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

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

cout << "Hello";

}

}

What is the time complexity?

O(n)

O(n log n)

O(n²)

O(n³)

3.

MULTIPLE CHOICE QUESTION

20 sec • 2 pts

What is the time complexity of the following algorithm?

int i = 1;

while (i < n) {

i = i * 2;

}

O(n)

O(log n)

O(n log n)

O(n²)

4.

MULTIPLE CHOICE QUESTION

20 sec • 2 pts

What is the time complexity of the recursive function below?

void func(int n) {

if (n <= 1) return;

func(n/2);

}

O(n)

O(log n)

O(n log n)

O(n²)

5.

MULTIPLE CHOICE QUESTION

20 sec • 2 pts

If a problem of size n is divided into two subproblems of size n/2 and combined in O(n) time, what is the overall time complexity using the Master Theorem?

O(n log n)

O(n²)

O(n)

O(log n)

6.

MULTIPLE CHOICE QUESTION

20 sec • 2 pts

What is the time complexity of inserting an element into a Binary Search Tree (BST) in the worst case?

O(1)

O(log n)

O(n)

O(n log n)

7.

MULTIPLE CHOICE QUESTION

20 sec • 2 pts

After inserting a new node in an AVL tree, which of the following operations might be required to maintain balance?

Only Left Rotation

Only Right Rotation

Either Left or Right Rotation

Left Rotation, Right Rotation, or Double Rotation

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?