Question: Consider the following algorithm for searching in an unsorted array. If the size of the array is 1, then check if it contains the element
Consider the following algorithm for searching in an unsorted array. If the size of the array is 1, then check if it contains the element to be searched. Otherwise, divide the array into two halves, and recursively search both halves. Which of (a)-(c) is false?
a. The running time of this algorithm is O(N)
b. The actual running time of this algorithm is likely to be better than sequential search.
c. This is an example of a divide-and-conquer algorithm
d. all of the above are true
e. none of the above are true
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
