Recall & Review
beginner
What is the main difference between Binary Search and Linear Search?
Binary Search divides the search space in half each step and requires a sorted list, making it faster. Linear Search checks each element one by one and works on any list.
Click to reveal answer
beginner
What is the time complexity of Linear Search and Binary Search?
Linear Search has O(n) time complexity because it may check every element. Binary Search has O(log n) time complexity because it halves the search space each step.
Click to reveal answer
beginner
Why does Binary Search require a sorted list?
Binary Search compares the target with the middle element to decide which half to search next. This only works if the list is sorted, so the halves are ordered.
Click to reveal answer
intermediate
In what scenario might Linear Search be faster than Binary Search?
If the list is very small or unsorted, Linear Search can be faster because it has no overhead of sorting or dividing the list.
Click to reveal answer
intermediate
What is the real cost difference between Binary Search and Linear Search in practice?
Binary Search uses fewer comparisons for large sorted lists, making it faster. Linear Search does more comparisons but works on any list. The cost depends on list size and whether sorting is needed.
Click to reveal answer
Which search algorithm requires the list to be sorted?
✗ Incorrect
Binary Search only works correctly on sorted lists because it divides the list based on order.
What is the worst-case time complexity of Linear Search?
✗ Incorrect
Linear Search may check every element, so its worst-case time is O(n).
How does Binary Search reduce the search space each step?
✗ Incorrect
Binary Search halves the search space by comparing with the middle element.
When might Linear Search be preferred over Binary Search?
✗ Incorrect
Linear Search works on unsorted or small lists without extra overhead.
Which search algorithm generally uses fewer comparisons on large sorted lists?
✗ Incorrect
Binary Search uses fewer comparisons by halving the search space each step.
Explain the key differences in how Binary Search and Linear Search work and their cost implications.
Think about how each algorithm finds the target and what that means for speed.
You got /5 concepts.
Describe scenarios where Linear Search might be better than Binary Search despite its higher time complexity.
Consider practical cases where sorting or complexity is not worth it.
You got /4 concepts.