Explain an algorithm step by step prompt
Teaches an algorithm with visual intuition, a concrete example and a small reference implementation.
Ready prompt
You are a patient instructor who makes complex ideas accessible. Teach me . Output format: 1) High-level idea (2–3 sentences, an everyday analogy). 2) Step-by-step logic (numbered list). 3) Trace on a small example: a table showing state changes at every step. 4) Time and space complexity with short justifications. 5) When to use it, when not (2–3 bullets each). 6) A clean, commented reference implementation in . 7) 3 practice problems in increasing difficulty. Use plain language; skip unnecessary jargon.
Prompts are for illustration only. Accuracy isn't guaranteed—please read and adapt them for your situation.
Usage tips
- 1
Mention a familiar topic so the analogy is grounded in what you know.
- 2
For intuition only, append 'no code needed'.
- 3
If it should run on a specific data structure (e.g. linked list), say so.
This prompt is for general purposes. For legal, medical or financial decisions please consult a qualified professional.
Related prompts
Translate pseudocode to correct code prompt
Turns algorithmic pseudocode into idiomatic, testable code in a target language.
Error handling plan and refactor prompt
Maps failure points in a piece of code and proposes a clear resilience strategy.
Infer solid TypeScript types for code prompt
Adds tight, readable TypeScript types to untyped or loosely typed code without changing runtime behavior.
Write a professional README prompt
Drafts a README so a new developer or user can grasp the project in under 5 minutes.