Practice mode Data Structures

Which growth rate is the slowest for large values of n?

Correct answer C. O(log n)

Explanation

Ordered from slowest to fastest growth, these are O(log n), O(√n), O(n) and O(n log n). A logarithm grows extremely slowly: doubling n adds only one to log₂ n. The square root may look small, but for n equal to one million √n is 1000 while log₂ n is about 20. Algorithms such as binary search achieve logarithmic time.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.