Question: In each step of insertion sort algorithm, a new element has to be inserted into an already sorted sub array. Instead of using sequential search

 In each step of insertion sort algorithm, a new element has

In each step of insertion sort algorithm, a new element has to be inserted into an already sorted sub array. Instead of using sequential search to determine the location of new element which takes O(o) time, we can use binary search since the sub array is sorted which takes O(log n) time. Now what will be the complexity of the insertion sort? Clearly explain the logic. 1. 12]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!