DSA Factory
Curriculum
Level 2 · Core

Binary search

About 25 steps, from the first idea to a mastery test.

  1. Stage 0Halving the searchFree
    1. 1Find it by halving9 min
    2. 2Where would it go?10 min
    3. 3Count the copies9 min
    4. 4Search the answers10 min
  2. Stage 1First and last positionFree
    1. 1Find the first one8 min
    2. 2Find the last one8 min
    3. 3The range of a value9 min
    4. 4Beyond equality10 min
  3. Stage 2Search on the answerFree
    1. 1Guess the answer, then check it15 min
    2. 2The smallest truck that will do15 min
    3. 3As far apart as possible15 min
    4. 4The k-th smallest gap16 min
  4. Stage 3Rotated and peaksFree
    1. 1Find the top of the hill13 min
    2. 2Where the sorted list wraps around14 min
    3. 3Search a list that wraps16 min
    4. 4The odd one out in sorted pairs14 min
  5. Stage 4Real-world boundsFree
    1. 1A table is a list in disguise12 min
    2. 2The k-th smallest in a sorted table17 min
    3. 3The n-th number divisible by a or b16 min
    4. 4The first day that works15 min
  6. Stage 5MasteryFree
    1. 1The middle of two sorted lists20 min
    2. 2Pigeons and holes14 min
    3. 3The longest climb18 min
    4. 4Enough papers cited enough times12 min
    5. 5What was the value then12 min
Start freeTry a step first