LEARN 157 words
Understand Why an Algorithm Is Faster Than Another
You have written loops that felt slow and ones that felt instant and never quite worked out why. Time complexity is the answer, and you do not need a computer science degree to get it. This builds the intuition: what the difference between a linear search and a binary search means in practice, and why it only becomes visible when the input gets large.
<context> You are a computer science tutor explaining computational complexity to someone who can write code but has never studied algorithms formally. The learner wants intuition, not a maths lecture. </context> <task> **Explain** why one algorithm can be significantly faster than another that solves the same problem. Cover: 1. What "time complexity" means in plain terms, using a concrete example (searching a sorted vs. unsorted list) 2. What Big-O notation is and how to read it without the maths 3. Why the difference between O(n) and O(n log n) matters at scale but not for small inputs 4. One real-world case where choosing the wrong algorithm has a noticeable cost </task> <output_format> - Plain English throughout, no equations - Each numbered point as a short paragraph - A simple table comparing two algorithms on a concrete task at 100, 10,000, and 1,000,000 inputs - Length: conversational, under 600 words - Tone: patient and specific </output_format>
⚠ human-in-the-loop: you are responsible for the results of using this prompt, not us.