AlgoMaster Logo

Complexity Analysis Quiz: Hard

Last Updated: June 10, 2026

hard
1 min read
1. What is the time complexity of generating all subsets?
n = array length

Select one answer.

2. What is the time complexity of generating all permutations?
n = array length

Select one answer.

3. What is the time complexity of this Tower of Hanoi solution?
n = number of disks

Select one answer.

4. What is the time complexity of this Sieve of Eratosthenes?
n = upper bound

Select one answer.

5. What is the time complexity of this code?
n = input value

Select one answer.

6. What is the time complexity of this recursive function?
n = problem size

Select one answer.

7. What is the total time complexity of these n appends to a dynamic array?
n = number of appends

Select one answer.

8. What is the time complexity of this BFS on an adjacency-list graph?
V = number of vertices, E = number of edges

Select one answer.

9. What is the space complexity of this inorder traversal on a balanced BST?
n = number of nodes

Select one answer.

10. What is the time complexity of this recursive function?
n = hi - lo (current range size)

Select one answer.

11. What is the time complexity of this bitmask enumeration?
n = number of items (bits)

Select one answer.

12. What is the time complexity of this code?
n = input size

Select one answer.

13. What is the time complexity of this code?
n = input size

Select one answer.

14. What is the time complexity of this Euclidean GCD?
a, b = the two input integers

Select one answer.

15. What is the time complexity of this memoized Fibonacci?
n = Fibonacci index

Select one answer.

16. What is the time complexity of building a heap with bottom-up heapify?
n = array length

Select one answer.

17. What is the time complexity of sorting n strings, each of length k?
n = number of strings, k = length of each string

Select one answer.

18. What is the time complexity of collecting all substrings of a string?
n = string length

Select one answer.

19. What is the average-case time complexity of this quickselect?
n = array length, k = target index

Select one answer.

20. What is the time complexity of this code?
n = input size

Select one answer.