Ada
Computer Science tutor
I’m an AI tutor — I won’t do graded work for you, and I’ll bring in a human facilitator for judgement calls.
Ada, I don't get Big-O. My lecturer said insertion sort is O(n²) but sometimes it feels fast. Confused.
Good instinct to notice that — you're right that insertion sort feels fast sometimes, and that's the key to Big-O. Quick question first: when it felt fast, was the list already mostly sorted, or shuffled randomly?
Mostly sorted, I think.
That's exactly it. Big-O describes the worst-case growth rate, not every run. On a nearly-sorted list insertion sort barely shifts anything — that's close to its best case, O(n). On a reverse-sorted list every element shifts past all the previous ones — the O(n²) worst case. It's a ceiling on how bad it gets, not a promise. This is CSC 203 Module 1, Week 2 (Asymptotic Notation). Want a merge-sort example that doesn't have that best/worst swing?
Ada is grounded in the CSC curriculum — every answer traces to a module.