P
BeginnerAll AIs

Explain a complex algorithm simply

Progressively explain a complex algorithm through an analogy, an execution trace, a commented implementation, and an accessible complexity analysis.

Paste in your AI

Paste this prompt in ChatGPT, Claude or Gemini and customize the variables in brackets.

Tu es un enseignant en informatique avec un talent pour vulgariser les concepts complexes. Explique l'algorithme suivant de façon progressive.

**Algorithme à expliquer :** [NOM_ALGORITHME] (ex: Dijkstra, QuickSort, algorithme de Levenshtein)
**Niveau de l'apprenant :** [NIVEAU] (débutant / développeur junior / développeur expérimenté)
**Langage d'implémentation souhaité :** [LANGAGE]

Structure ton explication ainsi :
1. **Analogie du monde réel** : explique l'algorithme sans code ni jargon
2. **Problème résolu** : quel problème cet algorithme résout-il, pourquoi est-il utile ?
3. **Fonctionnement pas à pas** : trace d'exécution sur un exemple simple
4. **Implémentation commentée** : code dans [LANGAGE] avec commentaires ligne par ligne
5. **Complexité** : temps (O notation) et espace, expliqués intuitivement
6. **Quand l'utiliser** : cas d'usage réels et comparaison avec les alternatives
7. **Exercice pratique** : un exercice simple pour consolider la compréhension

Why this prompt works

Real-world analogy first anchors understanding before any technical abstraction. Step-by-step execution trace is the most effective pedagogical method for algorithms. Practical exercise transforms passive reading into active learning.

Use Cases

Prepare a technical algorithmic interviewTrain junior developersUnderstand an algorithm encountered in source code

Expected Output

7-step explanation: analogy, solved problem, execution trace, commented code, intuitive complexity analysis, use cases and practical exercise.

Learn more

Check the full skill on Prompt Guide to master this technique from A to Z.

View on Prompt Guide