3. Algorithms and Problem Solving
Complexity Analysis — Quiz
Test your understanding of complexity analysis with 5 practice questions.
Practice Questions
Question 1
Which of the following best describes the time complexity of the insertion sort algorithm in the average case?
Question 2
Which of these algorithms has a space complexity of $O(1)$ (constant space)?
Question 3
If an algorithm’s time complexity is $O(n \log n)$ and the input size increases from $n$ to $4n$, how will the runtime change?
Question 4
Which of the following is a correct example of an $O(n^2)$ time complexity algorithm?
Question 5
Which of the following best explains why $O(\log n)$ is considered efficient?
