ITPEC FE Morning April 2022 Question 9
ITPEC FE Morning April 2022 — Question 9 of 80
Binary Search — requires sorted data and halves the search space each step.
Binary search works by repeatedly dividing the search interval in half:
- Start at the middle element
- If target < middle → search left half
- If target > middle → search right half
- Repeat until found or interval is empty
Prerequisite: data must be sorted
Why not others:
- (a) "always faster than linear" — false; linear search can find the first element in 1 step, and is faster on very small datasets
- (b) "starts from the beginning" — false; binary search starts from the middle
- (d) "proportional to log₂N" — technically true for worst-case complexity, but (c) describes the fundamental requirement of the algorithm
Key rule: Binary search = sorted data + O(log N) comparisons.
AI-generated — may contain errors
The original exam layout is preserved in the image so diagrams, formulas, tables, and code remain accurate.
This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.