diff --git a/llm/sorting-algorithm-explainer.md b/llm/sorting-algorithm-explainer.md new file mode 100644 index 0000000..81aadff --- /dev/null +++ b/llm/sorting-algorithm-explainer.md @@ -0,0 +1,28 @@ +# Explain a Sorting Algorithm with Code (LLM Prompt) + +## Objective: +Use a Large Language Model (LLM) like ChatGPT or DeepSeek to explain a sorting algorithm step-by-step, with a code example in Python. + +--- + +## Prompt: +> “Explain how the Merge Sort algorithm works, step-by-step. Include a Python code implementation. Then describe the time and space complexity in simple terms. Finally, provide one use case where Merge Sort is better than Quick Sort.” + +--- + +## Expected LLM Response Structure: +1. **Algorithm Explanation** – What it does and how it works +2. **Code Implementation** – Merge Sort in Python (with comments) +3. **Complexity Analysis** – Time and Space complexity +4. **Use Case Example** – When and why to prefer Merge Sort + +--- + +## Test Scenario: +Try this prompt on ChatGPT-4, DeepSeek, or Ollama with LLaMA3 and verify if the response includes all expected parts. + +--- + +## Use Case: +This LLM prompt helps software engineers or students quickly understand and visualize a commonly asked algorithmic topic like Merge Sort, backed by both theory and implementation. +