Questions: Complexity Classes and Asymptotic Analysis

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

An O(n²) algorithm runs a problem of size n = 1,000 in 1 second. Approximately how long will it take for n = 1,000,000?

AAbout 1,000 seconds (~17 minutes)
BAbout 1,000,000 seconds (~11 days)
CAbout 2 seconds, since n only grew by a constant factor
DAbout 1,000,000,000 seconds (~31 years)
Question 2 Multiple Choice

Binary search runs in O(log n) time. Approximately how many comparisons does it need to search a sorted list of 1 billion items?

AAbout 500 million — it checks half the list on average
BAbout 1 million — it processes a fraction of the list
CAbout 30 — each comparison halves the remaining search space
DAbout 1,000 — it scans a small linear subset
Question 3 True / False

An O(n log n) sorting algorithm and an O(n²) sorting algorithm are essentially equivalent for large inputs — both are polynomial, so the performance gap is minor.

TTrue
FFalse
Question 4 True / False

Exponential-time algorithms (O(2^n)) are considered computationally intractable for large inputs because they grow faster than any polynomial function of n.

TTrue
FFalse
Question 5 Short Answer

What is the fundamental distinction between polynomial-time complexity classes and superpolynomial ones, and why does this distinction matter for practical algorithm design?

Think about your answer, then reveal below.