Binary Search
- Algorithm for finding a value in a collection of values
- Collection must have "array-like" structure
- random access to data through bracket operator
- example containers: array, vector, deque
- Collection must be sorted
- elements in increasing (or decreasing) order
- Idea: "Divide and Conquer"
- Efficiency:
- very fast
- no extra space required
|