Verification Log: 21_binary_search.txt

Original companion example or verification log for the tutorial, preserved with user paths redacted; execution scope follows the recorded run.

Search         0: result index       0, took 19 steps
Search    777778: result index  388889, took 20 steps
Search   1999998: result index  999999, took 20 steps
Search         3: result index      -1, took 20 steps
log2(1,000,000) ≈ 20 → at most ~20 steps
Insertion index for 85: 3
Grade levels: ['F', 'D', 'C', 'A']
Max batch size within 24GB: 61
Binary search for 1 on unsorted list [5, 1, 3, 9, 2]: (-1, 2) ← returns -1 even though 1 is present
Back to Tutorials Back to Learn →Back to top ↑
On this page
Tutorial diagram100%
Tutorial diagram