Observe that the while loop of lines 5 - 7 of the INSERTION-SORT procedure in Section 2.1

Question:

Observe that the while loop of lines 5 - 7 of the INSERTION-SORT procedure in Section 2.1 uses a linear search to scan (backward) through the sorted subarray A[1 ¬ j - 1]. Can we use a binary search (see Exercise 2.3-5) instead to improve the overall worst-case running time of insertion sort to Θ(n lg n)?
Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Essentials Of Modern Business Statistics With Microsoft Excel

ISBN: 9781285867045

6th Edition

Authors: David R. Anderson, Dennis J. Sweeney, Thomas A. Williams

Question Posted: