Glossary
Binary search
Binary search works on monotonic or sorted structures when you can discard half the search space each step. Typical complexity is O(log n). Clarify preconditions (sorted array, answer boundary) before coding.
Glossary
Binary search works on monotonic or sorted structures when you can discard half the search space each step. Typical complexity is O(log n). Clarify preconditions (sorted array, answer boundary) before coding.