What is the time complexity of calculating the nth Fibonacci number using the dynamic programming approach?
O(n)
O(n^2)
O(2^n)
O(n log n)
Which of the following sorting algorithms has the best average-case time complexity?
Selection Sort
Insertion Sort
Bubble Sort
Merge Sort
The Master Theorem is used to solve recurrence relations of a specific form. Which of the following forms is NOT suitable for the Master Theorem?
T(n) = aT(n-b) + f(n)
T(n) = √n * T(√n) + n
All of the above are suitable for the Master Theorem
T(n) = aT(n/b) + f(n)
What is the time complexity of searching for an element in an unsorted array of size 'n' in the worst-case scenario?
O(log n)
O(1)
Which of the following has a time complexity of O(n^2) in its worst-case scenario?
Heap Sort
QuickSort
If an algorithm has a time complexity of Ω(n log n), what can you conclude about its best-case runtime?
It will have a constant runtime regardless of input size.
It will always be faster than an algorithm with O(n) time complexity.
It will always be slower than an algorithm with O(n^2) time complexity.
It cannot be faster than an algorithm with O(log n) time complexity.
An algorithm processes an input of size 'n' by dividing it in half repeatedly until the size becomes 1. What is the most likely time complexity of this algorithm?
You have two algorithms for a task: Algorithm A with Θ(n) complexity and Algorithm B with O(n^2) complexity. Which statement is ALWAYS true?
Algorithm A and Algorithm B have the same efficiency in terms of time complexity.
It's impossible to compare the efficiency of the algorithms without knowing the exact implementation details.
Algorithm B might be faster for very small input sizes, but Algorithm A will eventually be faster as input grows.
Algorithm A will be faster than Algorithm B for all input sizes.
What is the Big-O notation of an algorithm that iterates through an array of size 'n' twice in nested loops?
A linear search algorithm iterates through an unsorted array to find a target element. What is its average-case time complexity?
O(n²)