What does binary search require of its input?
- AThe array length must be a power of two
- BThe array must contain only positive numbers
- CThe array must have no more than 1000 elements
- DThe array must be sorted
What does binary search require of its input?
What is the time complexity of linear search in an unsorted array of n elements (worst case)?
What is the time complexity of binary search on a sorted array?
What does the recurrence T(n) = T(n/2) + O(1) solve to?
The time complexity of naive recursive Fibonacci (fib(n) = fib(n−1) + fib(n−2)) is:
What is the amortised time complexity of appending to a dynamic array that doubles its capacity when full?
What are the time and space costs of computing the n-th Fibonacci number with a loop that keeps only the last two values?
Which statement about selecting the k-th smallest element of an unsorted array is correct?
Full step-by-step solutions: practise this topic on examproblems.com.