1. What is the value of the base-2 logarithm of 512, i.e. log2(512)\log_2(512)?

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

2. Around 18 teams made it to the final round of a basketball championship. If the team leaders' names are arranged in ascending order and binary search is applied, what is the maximum number of iterations needed to find a particular team leader?
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

3. For a standard binary search on a sorted array of length NN, what is the worst-case order of the number of iterations needed to determine that an element is not present?
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

4. In the best case, if we perform an optimized linear search on a sorted array of length NN, how many iterations are needed to determine that a searched value is not present when the value is smaller than the first element?
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

5. In an unsorted array, why can a standard linear search require NN comparisons in the worst case?
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

6. Consider the unsorted array A=[14,3,21,8,5]A = [14, 3, 21, 8, 5]. Using linear search from left to right, how many elements must be examined to find the value 8?

Explanation

Explanation

Explanation

Explanation

7. Suppose an unsorted array contains NN elements and a value is known to occur somewhere in the array. What is the worst-case time complexity of finding its position using linear search?
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

8. An unsorted array is searched for a value using linear search. If the value is found at the first position, what is the time complexity of the search in the best case?
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

9. Why can binary search be faster than linear search on a sorted array?
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation