1.3 KiB
1.3 KiB
slug | title | author | order | prerequisites | ||
---|---|---|---|---|---|---|
/silver/binary-search | Binary Search | Nathan Chen | 4 |
|
Binary search can be used on monotonic functions for a logarithmic runtime.
The Basic Application
Find an element in a sorted array in O(log N) time.
Tutorial
Problems
Binary Searching on the Answer
Oftentimes used when you need to find the "minimum" or "maximum" of some quantity that satisfies a property.
Tutorial
Problems
- USACO Silver Cownvention
- USACO Silver Cow Dance
- USACO Silver Social Distancing
- USACO Silver Loan Repayment
- Also needs some math and "sqrt" analysis
- USACO Silver Angry Cows