Question: Consider the following binary search algorithm (a classic divide and conquer algorithm) that searches for a value X in an sorted N-element array A and

Consider the following binary search algorithm (a classic divide and conquer algorithm) that searches for a value X in an sorted N-element array A and returns the index of matched entry:Binary Search (A[0..N-1], X) { low = 0 high = N - 1 while (low X) high else if (A[mid] < X) low = mid + 1 }

Assume that you have Y cores on a multi-core processor to run Binary Search. Assuming that Y is much smaller than N, express the speedup factor you might expect to obtain for values of Y and N. Plot these on a graph.


Many computer applications involve searching through a set of data and sorting the data. A number of efficient searching and sorting algorithms have been devised in order to reduce the runtime of these tedious tasks. In this problem we will consider how best to parallelize these tasks.

Binary Search (A[0..N-1], X) { low = 0 high = N - 1 while (low X) high else if (A[mid] < X) low = mid + 1 } else high) / 2 mid - 1 return mid // found } return -1 // not found

Step by Step Solution

3.39 Rating (155 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres a breakdown of the expected speedup factor and a plotted graph Speedup Factor Ideal Speedup In ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Organization Design Questions!