WhiteBox
DSA
Start coding DSA Beyond LeetCode System Design AI Engineering White Room
RoadmapProblem sets
Quizzes Dan Ladder Contests Templates Graph Editor
Guides Library
Login Sign up
Sign up Log in

Workspaces

Start coding DSA Beyond LeetCode System Design AI Engineering White Room

DSA

Overview Roadmap Problem sets Quizzes Dan Ladder Contests Templates Graph Editor CP Guessr

Library

Library Guides

Community

Leaderboard Contributors Refer & Earn Cosmetics

Tools

Resume Reviewer Job Boards Changelog

Arrays and searching 0/120

DSA 0 of 360 problems solved
0%
Overview

Curriculum

    1. Hashing 0/11
    2. Two pointers 0/12
    3. Sliding window 0/21
    4. Prefix sums 0/29
    5. Binary search 0/20
      1. Binary search technique
      2. Sorted arrays 0/10
      3. Search on the answer 0/10
    6. Heaps 0/11
    7. Greedy and intervals 0/9
    8. Linked lists 0/8
    9. Data structure design
  1. DSA
  2. / Arrays and searching

Binary search · 1 of 3

Binary search technique

Find a value in a sorted array by halving the range, then find the first position where a yes-or-no question changes from NO to YES.

2,739 words · 13 min read

Lesson Reading2
  • cp-algorithms.com Binary search The same search written with a loop invariant in which the left end is a NO and the right end is a YES, then the lower and upper bound and search over real numbers. cp-algorithms.com (opens in a new tab)
  • research.google Extra, Extra - Read All About It: Nearly All Binary Searches and Mergesorts are Broken How (low + high) / 2 overflowed in the Java library, and the midpoint forms that avoid it. research.google (opens in a new tab)
Lesson: Binary search technique
Overview Roadmap Problem sets Log in