What is the time complexity of Binary Search in the worst case?

DS Quizz

Quiz
•
Education
•
University
•
Medium
Auzoom four
Used 1+ times
FREE Resource
12 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
O(n)
O(log n)
O(n log n)
O(n^2)
2.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Which of the following is a stable sorting algorithm?
Quick Sort
Merge Sort
Heap Sort
Selection Sort
3.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
In which case does Linear Search outperform Binary Search?
When the array is sorted
When the array has duplicate elements
When the array is small and unsorted
When the array is large and sorted
4.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Which of the following is true about the time complexity of Selection Sort?
It is O(n) in the worst case.
It is O(n log n) in the best case.
It is O(n^2) in both the worst and best cases.
It is O(log n) in the worst case.
5.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Consider the following pseudocode:
for i = 1 to n:
for j = 1 to i:
print(i, j)
O(n)
O(n log n)
O(n^2)
O(n^3)
6.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Consider the following pseudocode:
for i = 0 to n-1:
minIndex = i
for j = i+1 to n:
if arr[j] < arr[minIndex]:
minIndex = j
swap arr[i] with arr[minIndex]
What is the time complexity of this algorithm?
A) O(n)
B) O(n log n)
C) O(n^2)
D) O(n^3)
7.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Consider the following pseudocode:
for i = 1 to n:
for j = 1 to n:
for k = 1 to n:
print(i, j, k)
What is the time complexity of this algorithm?
O(n)
O(n^2)
O(n^3)
O(n log n)
Create a free account and access millions of resources
Similar Resources on Quizizz
15 questions
Final Quiz TT HCM

Quiz
•
University
8 questions
Algorithms

Quiz
•
University
10 questions
DAA Quiz 1

Quiz
•
University
10 questions
DAA Quiz

Quiz
•
University
15 questions
Sorting Quiz

Quiz
•
University - Professi...
10 questions
Curriculum Pretest

Quiz
•
University
14 questions
Biện pháp tu từ

Quiz
•
6th Grade - University
15 questions
KG Quiz (DPA)

Quiz
•
KG - Professional Dev...
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade