Are Two Loops Twice as Slow? Why O(2n) Is Still O(n)

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.

Updated

Cheat sheet: Are Two Loops Twice as Slow? Why O(2n) Is Still O(n)
Category
Data Structures
Level
Apprentice
Tags
Big-O Notation, Constant Factor, Dominant Term, software-development