This visualisation uses AI Generated code, finetuned for the best visualisation, not code quality
binarysearch01.mov
Interactive Raylib visualizer for binary search, focusing on the shrinking search window, midpoint decisions, and why the invariant survives each discard step.
- How
low,mid, andhighdefine the active search window - Why each comparison lets half of the remaining candidates disappear
- How the invariant changes when the target is found versus excluded
- A breakdown view that keeps the active range obvious at all times
flowchart LR
A["Sorted Array"]
B["Choose Midpoint"]
C["Compare To Target"]
D["Discard Left or Right Half"]
E["Shrink Search Window"]
F["Found or Exhausted"]
A --> B
B --> C
C --> D
D --> E
E --> B
C --> F
q: quit- The app exposes the remaining step and scene controls in the active UI
make run