Questions: Algorithm Complexity and Big-O Notation

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

Algorithm A runs in O(n) time and Algorithm B runs in O(n²) time. A student claims A is always faster than B for any input size. What is the strongest counterargument?

AThe claim is correct — linear algorithms are always faster than quadratic ones
BBig-O only describes asymptotic behavior; for small inputs or with large constant factors, A could actually run slower than B in practice
CThe claim is wrong because O(n) and O(n²) describe memory usage, not runtime
DThe student should compare Ω bounds instead of O bounds to determine which is faster
Question 2 Multiple Choice

Suppose f(n) = 1000n and g(n) = n². Which statement is true?

Af is Θ(g) because both are polynomial functions
Bf and g have the same Big-O class because both involve n
Cf is O(g) but g is NOT O(f)
Dg is O(f) because n² = n × n involves the same n as f
Question 3 True / False

An algorithm proved to be Θ(n log n) is also O(n log n).

TTrue
FFalse
Question 4 True / False

The statement 'comparison-based sorting requires Ω(n log n) comparisons' means that no specific known sorting algorithm can do better — but a hypothetical future algorithm might.

TTrue
FFalse
Question 5 Short Answer

Why does the formal definition of Big-O (f(n) ≤ c · g(n) for all n ≥ n₀) justify dropping constant factors and lower-order terms?

Think about your answer, then reveal below.