Model answer
From slowest to fastest growth: log n, n, n log n, n², 2ⁿ, n!. Constant factors can affect small inputs, but not this eventual ordering.
Use the key terms, then explain the reasoning.
Complexity classes group problems and algorithms by resource growth: constant, logarithmic, linear, linearithmic, polynomial, exponential, and factorial.
Growth classes predict how quickly resource demands explode. Doubling n barely affects logarithmic work, doubles linear work, roughly doubles-plus-one-pass linearithmic work, and quadruples quadratic work.
P and NP classify decision problems rather than individual programs. P contains problems solvable in polynomial time; NP contains problems whose proposed solutions can be verified in polynomial time. Whether P equals NP remains unknown.
This is primarily a conceptual or selection topic. Use the linked implementation topics in this section to see the invariant expressed in C++.
Open a prompt when you are ready to check your answer.