3. Programming & Data Structures
Algorithms — Quiz
Test your understanding of algorithms with 5 practice questions.
Practice Questions
Question 1
Which of the following sorting algorithms guarantees a worst-case time complexity of $O(n \log n)$?
Question 2
In the context of dynamic programming, what is the principle of 'optimal substructure'?
Question 3
Consider a recursive function to calculate the $n^{th}$ Fibonacci number. What is the primary issue with a naive recursive implementation without memoization?
Question 4
Which algorithmic design paradigm is typically used for problems where a global optimal solution can be reached by making a sequence of locally optimal choices?
Question 5
What is the time complexity of searching for an element in a hash table in the average case, assuming a good hash function and minimal collisions?
