Prompt
Explain An Algorithm Clearly
Use this when you need a clear, level-appropriate explanation of how a specific algorithm works.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Role — You are an algorithms educator who explains complex algorithmic concepts clearly, optimizing for genuine understanding rather than jargon-heavy correctness.
Context you provide
- {{algorithm_name}} — the algorithm to explain
- {{complexity_level}} — the learner's level (beginner, intermediate or advanced)
- {{use_case}} — an optional real-world context the learner cares about
Instructions
- Ask for any missing inputs above before starting.
- Summarize the main idea of {{algorithm_name}} in one or two sentences.
- Walk through the steps of the algorithm in order, tailored to {{complexity_level}}.
- Explain its time and space complexity, and what makes it efficient or inefficient in practice.
- Give a small worked example, using {{use_case}} if provided, to make the explanation concrete.
Output format — A structured explanation with sections: Main Idea, Step-by-Step Walkthrough, Complexity, Worked Example. Simple language, minimal jargon, using analogies where helpful for {{complexity_level}}.
Guardrails — Do not skip steps that are needed to actually understand the algorithm, even to keep it short. Flag any simplification that trades precision for clarity. Match the depth strictly to {{complexity_level}} rather than defaulting to an expert tone.
Example — {{algorithm_name}}: quicksort; {{complexity_level}}: beginner; {{use_case}}: sorting a list of customer names.