algorythms
All Patterns
Pattern 11

Modified Binary Search

Modified Binary Search

Classic binary search adapted: search in rotated arrays, answer-space binary search, or find a boundary condition instead of an exact match.

Time

O(log n)

Space

O(1)

Recognize it when

  • Sorted or rotated sorted array
  • "Find minimum/maximum X such that condition holds" — search the answer space
  • Find left/right boundary of a range
Progress0/9
0 solved0 attempted