Java Zero to All All questionsPractise free
Interview questions › Java Foundations — Zero to Basics › Efficiency & Big-O — Measuring Speed From Zero

Why do we drop constants and lower-order terms, so O(2n + 5) becomes O(n)?

Level I · BeginnerEfficiency & Big-O — Measuring Speed From Zero
Short answer

Big-O captures the growth trend at large n, where the dominant term swamps everything else and constant multipliers do not change the shape of the curve.

Explanation

For big n, 2n + 5 grows essentially like n, so we call it O(n). Constants and small terms matter for real wall-clock tuning, but for comparing how algorithms SCALE they are noise, so we drop them to focus on the order of growth.

Common mistakes
  • Keeping constants like O(2n) in the final answer.
  • Thinking dropping constants means they never matter in practice.

Can you say this out loud in two minutes? Drill it in a timed mock interview, with flashcards and runnable code for Efficiency & Big-O — Measuring Speed From Zero.

Practise free

More on Efficiency & Big-O — Measuring Speed From Zero