3. Algorithms

Complexity — Quiz

Test your understanding of complexity with 5 practice questions.

Read the lesson first

Practice Questions

Question 1

An algorithm's time complexity is described as $O(n^2)$. If the input size $n$ is increased from 5 to 15, by what factor does the execution time approximately increase?

Question 2

Which of the following best describes the 'amortized analysis' of an algorithm's time complexity?

Question 3

Consider a recursive function that calculates the factorial of $n$. What is the space complexity of this function due to the call stack?

Question 4

An algorithm processes a graph with $V$ vertices and $E$ edges. If the algorithm uses an adjacency matrix representation, which operation typically has a time complexity of $O(V^2)$?

Question 5

What is the time complexity of Bubble Sort in its best-case scenario?
Complexity Quiz — A-Level Computer Science | A-Warded