Reading Big-O
Reading Big-O: Are Two Loops Twice as Slow? Why O(2n) Is Still O(n), Fast in the Demo, Slow for Users: Best, Worst and Average.
Updated
- Are Two Loops Twice as Slow? Why O(2n) Is Still O(n) (Apprentice): Big-O keeps only the part of the step count that grows fastest and drops the rest, so 2n steps is O(n) and n² + n steps is O(n²). Here's why, and when the small stuff still matters.
- Fast in the Demo, Slow for Users: Best, Worst and Average (Apprentice): Explain why a search that was instant in your demo is slow for users, name its best, worst and average cases, and see why Big-O usually promises the worst one.