Binary Insertion Sort
Binary Search
We can use binary search to reduce the number of comparisons in normal insertion sort. Binary Insertion Sort find use binary search to find the proper location to insert the selected item at each iteration.
In normal insertion, sort it takes O(i) (at ith iteration) in worst case. we can reduce it to O(logi) by using binary search.
Table Of Content

Implementation of Binary Insertion Sort in C
Output:
Sorted array: 0 12 17 23 31 37 46 54 72 88 100
Time Complexity: The algorithm as a whole still has a running worst case running time of O(n2) because of the series of swaps required for each insertion.
[ad type=”banner”]Implementation of Binary Insertion Sort in JAVA
In this implementation, I have used library functions for binary search and shifting array to one location right
Output:- Before Sorting - [4, 10, 3, 1, 9, 15] After Sorting - [1, 3, 4, 9, 10, 15]



