Question

6.3.1 [10] <§6.2> Consider the following binary search algorithm (a classic divide and conquer algorithm) that...

6.3.1 [10] <§6.2> Consider the following binary search algorithm (a classic divide and conquer algorithm) that searches for a value X in a sorted N-element array A and returns the index of matched entry:

    BinarySearch(A[0..N−1], X) {
       low = 0
       high = N −1
       while (low <= high) {
           mid = (low + high) / 2
           if (A[mid] >X)
              high = mid −1
           else if (A[mid] <X)
              low = mid + 1
           else
              return mid // found

}

       return −1 // not found
    }

Assume that you have Y cores on a multi-core processor to run BinarySearch. 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.

0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
6.3.1 [10] <§6.2> Consider the following binary search algorithm (a classic divide and conquer algorithm) that...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT