
Algorithm Analysis and Design

Quiz
•
Engineering
•
University
•
Hard
EMMANUEL 210055
Used 1+ times
FREE Resource
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
Create a free account and access millions of resources
Similar Resources on Wayground
25 questions
Quiz on Strength of Materials

Quiz
•
University
20 questions
DERECHO INFORMÁTICO 1

Quiz
•
University
20 questions
Electro2 MSW2

Quiz
•
University
20 questions
REPASO UNIDAD 1 TCA

Quiz
•
University
22 questions
Examen Primer parcial 02_01

Quiz
•
University
26 questions
Khai niem ve du toan

Quiz
•
University
20 questions
Stavební inženýrství - Kvíz

Quiz
•
University
20 questions
ARQ2_quiz_1-25

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Engineering
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University