Example result illustrating this prompt's visual direction. Actual results may vary by model, reference image and settings.
Binary Search Interval Narrowing from Notebook Photos
Convert sorted-array notes into a walkthrough of shrinking search bounds.
Prompt
Transform the uploaded photo of handwritten algorithm notes into a clean, readable visual walkthrough. Treat the photo as the source of truth: preserve its algorithm, legible input values and stated conventions; remove glare, skew and paper clutter while retaining a small source-note inset. Do not invent unreadable values or silently repair contradictory logic; ask one focused question if an essential detail cannot be read. Use the optional example below only when the source has no worked example and label it "Illustrative example". Check that the input is sorted and preserve its values. Show inclusive low and high bounds and mid=floor((low+high)/2) for each iteration. A failed comparison excludes mid by setting low=mid+1 or high=mid-1. For an unsorted input, flag the precondition and ask for a sorted example rather than silently altering the notes. Optional labeled example: [2, 5, 8, 12, 16, 23, 38], target 23; mid index 3 holds 12, then mid index 5 holds 23. State iterative worst-case time O(log n), auxiliary space O(1). Layout: Stack interval panels vertically; use a dark bracket for the active interval, amber for mid and faded cells for excluded regions. Use an off-white canvas, dark high-contrast sans-serif labels and spacious cells. Include the algorithm title, input, numbered steps, final result and the stated complexity note. Pair colors with labels or outlines so meaning does not depend on color alone. Keep all values and state changes consistent across panels. If space is tight, simplify decoration rather than omitting essential steps. Output one polished educational image; treat it as a visual explanation, not executable code. Before finalizing, check the trace and all visible labels against the source.
How to use it
- Upload a clear photo of the relevant handwritten algorithm notes.
- Paste this prompt and specify any required input or indexing convention.
- Check the rendered values and labels against your source before publishing.
Common failure fixes
- If excluded cells remain active, redraw only the current inclusive interval.
- If the search stalls, exclude the tested midpoint when updating bounds.
- If the source array is unsorted, flag that precondition instead of claiming binary search is valid.