
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
20 questions
Quiz Elemen Mesin-2

Quiz
•
University
20 questions
wp_css

Quiz
•
University
20 questions
LM EX ESP - UNID IV | ENFOQUE LOGISTICO, INVENTARIO Y COMPRAS

Quiz
•
University
20 questions
Diodos y semiconductores

Quiz
•
University
23 questions
Industrial Engineering Quiz

Quiz
•
University
20 questions
EXAMEN 2DO PARCIAL 01_03

Quiz
•
University
20 questions
Funcionamiento Básico de una Máquina CNC

Quiz
•
University
20 questions
DEEP LEARNING

Quiz
•
University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Engineering
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University