AlgoMaster Logo

Complexity Analysis Quiz: Medium

Last Updated: June 10, 2026

medium
1 min read
1. What is the time complexity of this code?
n = array length

Select one answer.

2. What is the time complexity of this code?
n = length of arr and sorted

Select one answer.

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

Select one answer.

4. What is the time complexity of this recursive Fibonacci?
n = Fibonacci index

Select one answer.

5. What is the space complexity of this recursive sum?
n = array length

Select one answer.

6. What is the time complexity of building this string?
n = number of words

Select one answer.

7. What is the time complexity of this primality check?
n = number being tested

Select one answer.

8. What is the average-case time complexity of this frequency count?
n = array length

Select one answer.

9. What is the time complexity of this sliding window?
n = array length, k = sum limit

Select one answer.

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

Select one answer.

11. What is the time complexity of pushing all elements into this heap?
n = array length

Select one answer.

12. What is the time complexity of this fast exponentiation?
n = exponent

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 code?
n = input size

Select one answer.

15. What is the time complexity of this merge sort?
n = hi - lo (number of elements being sorted)

Select one answer.

16. What is the space complexity of this code?
n = array length

Select one answer.

17. What is the time complexity of this recursive function?
n = initial value of size

Select one answer.

18. What is the time complexity of this matrix traversal?
n = rows, m = columns

Select one answer.

19. What is the time complexity of this next-greater-element algorithm?
n = array length

Select one answer.

20. What is the worst-case time complexity of this deduplication?
n = array length

Select one answer.