Paths Subjects Questions Quizzes Pricing Search
Algorithms & Data Structures Intermediate Pro

Binary Search

Halve the search space to turn linear scans into logarithmic-time solutions

45 min read 0 views

Learn the classic binary search template and its off-by-one traps, then generalize the idea to 'binary search on the answer' over monotonic predicates. Covers rotated arrays, medians of two arrays, matrix search, peak finding, and weighted sampling.

Practice questions (8)

  • Find the Insertion Index

    Beginner
    View →
  • First and Last Occurrences of a Number

    Intermediate
    View →
  • Cutting Wood

    Intermediate
    View →
  • Find the Target in a Rotated Sorted Array

    Intermediate
    View →
  • Find the Median From Two Sorted Arrays

    Advanced
    View →
See all 8 questions →

We use cookies for product analytics to improve OmniAtlas. See our Privacy Policy.