Conceptual illustration of an amber tile being inserted into an ordered line of teal and ivory tiles.

Example result illustrating this prompt's visual direction. Actual results may vary by model, reference image and settings.

Insertion Sort Prefix Growth from Sorting Notes

Transform sorting notes into a visual trace of key selection, shifting and insertion.

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". Show the sorted prefix, selected key held separately, each rightward shift and the final insertion. Preserve the full multiset of values. Optional labeled example: [5, 2, 4, 1]; outer-pass results are [2, 5, 4, 1], [2, 4, 5, 1] and [1, 2, 4, 5]. Show intermediate shifts for the insertion of 4. Use the stable variant that shifts only elements strictly greater than the key. State worst-case O(n^2) time and O(1) auxiliary space. Layout: Use three outer-pass bands and a magnified middle-pass inset; teal marks the sorted prefix and an amber floating tile marks the held key. 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.
Recommended: ChatGPT
Upload your photo to the AI tool first, then use this prompt. The prompt asks the model to preserve identity and key visual features.

How to use it

  1. Upload a clear photo of the relevant handwritten algorithm notes.
  2. Paste this prompt and specify any required input or indexing convention.
  3. Check the rendered values and labels against your source before publishing.

Common failure fixes

  • If a value disappears during shifting, keep the selected key in a visible temporary slot.
  • If equal values reverse order, shift only values strictly greater than the key.
  • If each pass looks fully sorted, highlight only the prefix completed at that pass.