Explain the difference between a linear search and a binary search in terms of time complexity and efficiency.
Instructor solution
A linear search has a time complexity of
Think you've got it?
Which of the following is a requirement for using a binary search algorithm?
- A.
The list must be sorted
- B.
The list must contain no duplicate values
- C.
The list must be of a certain minimum size
- D.
The list must be unsorted
You may exit out of this review and return later without penalty.