Skip to main content

Binary Search

This page provides links to solutions that use the binary search technique.

Overview

Binary search is an efficient algorithm used to search for a specific element in a sorted array or list. It works by repeatedly dividing the search interval in half.

How to Spot These Problems

You can identify binary search problems if the problem requires you to:

  • Search for a specific element or target value in a sorted array or list.
  • Determine the maximum or minimum value that satisfies certain conditions.
  • Find the first or last occurrence of a particular element in a sorted array.
  • Split an array or range into subarrays or subranges and solve subproblems within these divisions.

Leetcode Problem Set