What is the time complexity of a binary search algorithm?

Fundamentals of Algorithms and Design

Quiz
•
English
•
University
•
Medium
Vignesh Rajkumar
Used 1+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 5 pts
O(n)
O(log n)
O(1)
O(n log n)
2.
MULTIPLE CHOICE QUESTION
2 mins • 5 pts
Explain the difference between Big O, Big Θ, and Big Ω notations.
Big O is for lower bounds, Big Θ is for upper bounds, and Big Ω is for tight bounds.
Big O is for upper bounds, Big Θ is for tight bounds, and Big Ω is for lower bounds.
Big O is for average case, Big Θ is for worst case, and Big Ω is for best case.
Big O is for constant time, Big Θ is for linear time, and Big Ω is for exponential time.
3.
MULTIPLE CHOICE QUESTION
2 mins • 5 pts
Which data structure would you use to implement a priority queue?
Linked list
Binary heap
Stack
Array
4.
MULTIPLE CHOICE QUESTION
2 mins • 5 pts
Aarav is designing a recursive function to help him sort a list of books. He realizes that the function uses O(n) space to store the intermediate results. What is the space complexity of Aarav's recursive function?
O(n^2)
O(1)
O(n)
O(log n)
5.
MULTIPLE CHOICE QUESTION
2 mins • 5 pts
Describe the process of depth-first search (DFS) in graph traversal.
DFS only explores the shortest path in a graph.
DFS visits all nodes in a random order.
DFS requires a queue to keep track of nodes.
Depth-first search (DFS) explores a graph by going as deep as possible along each branch before backtracking.
6.
MULTIPLE CHOICE QUESTION
2 mins • 5 pts
What is the primary advantage of using a hash table over a binary search tree?
Faster average-case time complexity for lookups, insertions, and deletions.
Easier to implement than a binary search tree.
More efficient memory usage than a binary search tree.
Better suited for ordered data than a binary search tree.
7.
MULTIPLE CHOICE QUESTION
2 mins • 5 pts
How does the merge sort algorithm achieve its time complexity of O(n log n)?
Merge sort has a time complexity of O(n) due to its linear merging process.
Merge sort achieves O(n log n) by sorting the array in a single pass.
Merge sort achieves a time complexity of O(n log n) by recursively dividing the array and merging sorted halves.
Merge sort uses a bubble sort technique to achieve O(n log n).
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
What's Missing Letters?

Quiz
•
KG - University
10 questions
Mastering Problem Solving Methods

Quiz
•
University
10 questions
Adjective-noun collocations

Quiz
•
10th Grade - University
10 questions
Information systems analysis and design

Quiz
•
University
20 questions
technology (Computer)

Quiz
•
3rd Grade - University
15 questions
Segmenting Words

Quiz
•
3rd Grade - University
20 questions
Pathways RW 2 Unit 3A

Quiz
•
University
15 questions
BAB 8 (The elephant is big)

Quiz
•
2nd Grade - University
Popular Resources on Wayground
25 questions
Equations of Circles

Quiz
•
10th - 11th Grade
30 questions
Week 5 Memory Builder 1 (Multiplication and Division Facts)

Quiz
•
9th Grade
33 questions
Unit 3 Summative - Summer School: Immune System

Quiz
•
10th Grade
10 questions
Writing and Identifying Ratios Practice

Quiz
•
5th - 6th Grade
36 questions
Prime and Composite Numbers

Quiz
•
5th Grade
14 questions
Exterior and Interior angles of Polygons

Quiz
•
8th Grade
37 questions
Camp Re-cap Week 1 (no regression)

Quiz
•
9th - 12th Grade
46 questions
Biology Semester 1 Review

Quiz
•
10th Grade