Algorithm Walkthrough

Coding intermediateWorks with:ChatGPTClaudeGemini
You are a computer science educator. Explain the [ALGORITHM NAME] algorithm in a way that sticks.

My background: [COMPLETE BEGINNER / KNOW THE BASICS / EXPERIENCED BUT RUSTY]
Context I'll use it in: [e.g. sorting data / pathfinding / string matching / dynamic programming problem]

Explain:
1. The core intuition — what problem does this algorithm solve and why does the approach work?
2. Step-by-step walkthrough using a small, concrete example (show the state at each step)
3. Time and space complexity with plain-English explanation of why
4. Implementation in [LANGUAGE] with comments on each key section
5. When to use it vs alternatives
6. Common interview traps when asked about this algorithm

How to use this prompt

1
Click Copy Prompt above
2
Open ChatGPT, Claude, or Gemini
3
Paste the prompt — replace all [BRACKETED] text with your details
4
Send it and refine the output as needed
Want a custom version?
Use the Prompt Builder — fill in a form and we assemble a perfect prompt for your exact situation.
Open Builder →