Back to Dashboard

Pro pattern

Upgrade to Pro to access this pattern and all 22 patterns.

Upgrade
PATTERN

Binary Search

Find elements or boundaries in sorted data in O(log n) time by repeatedly halving the search space. Also applies to "binary search on the answer space" for optimization problems.

Learn Binary SearchExplanation, templates & reference

Binary Search

easy

Search a 2D Matrix

medium

Koko Eating Bananas

medium

Find Minimum in Rotated Sorted Array

medium

Search in Rotated Sorted Array

medium

Median of Two Sorted Arrays

hard