Practice question · Multiple choice
Two algorithms are both O(n). One runs in 3n operations, the other in 3000n. Big-O calls them identical. Is the notation failing?
Hints
- Ask what a constant factor depends on, and whether it is stable across machines.
- Both algorithms double their work when n doubles. What question is that answering?
Show the answer
D. No, constants are discarded because they depend on the machine
Why
The discard is deliberate: constants shift with hardware, compiler and cache while the growth rate does not, so big-O captures the portable part. It answers 'what happens as the input grows' and never claimed to answer 'which is faster today', that question is settled by measurement.
Practise Complexity Analysis
The app has 6 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.