ArtOfCode.org
Toggle Menu
Home
Online Rust Compiler
Tutorials
Algorithms 101
Html Css Tutorial
Javascript Tutorial
Blog
All Posts
Searching Algorithms Fundamentals
Check understanding of search methods.
1. What is the worst-case time complexity of linear search?
O(1)
O(n)
O(log n)
O(n²)
2. Which condition is strictly required for binary search to work efficiently?
Unsorted data
Sorted data
Random access memory (RAM)
Duplicate elements
3. Which search algorithm is most efficient for finding an element in a sorted array with random access?
Linear search
Binary search
Jump search
Interpolation search
4. Which of the following are characteristics of linear search?
Requires sorted data
Works on unsorted data
Time complexity O(n)
Faster than binary search for large datasets
5. Which search algorithms require the input data to be sorted?
Linear search
Binary search
Interpolation search
Jump search
6. Binary search can be implemented iteratively or recursively.
True
False
7. In the best case, linear search has a time complexity of O(1).
True
False
8. What is the term for the value being looked up in a search algorithm?
9. Name the search algorithm that estimates the target's position using a formula based on the target value and dataset bounds (abbrev. allowed).
10. What is the worst-case time complexity of binary search (use big O notation)?
Reset
Answered 0 of 0 — 0 correct