Startseite Mathematik By combining binary search and insertion sort, a sorting method for small input size
Kapitel
Lizenziert
Nicht lizenziert Erfordert eine Authentifizierung

By combining binary search and insertion sort, a sorting method for small input size

  • Bhawnesh Kumar , Aditya Bhatt und Neeraj Panwar
Veröffentlichen auch Sie bei De Gruyter Brill
Algorithms
Ein Kapitel aus dem Buch Algorithms

Abstract

Insertion sort, one of the popular sorting methods having average time complexity O(n2), is based on the decrease and conquer strategy. We insert elements one by one in the sorted part and decrease the size of the unsorted portion, instead of a simple comparison method for insertion of elements in the sorted portion if we apply the binary search approach to locate the appropriate position for the inserting element in the sorted part. This will reduce the number of key comparisons; the only problem with this approach is to shift the elements one place to its right which are greater than A[i]. But the convergence of this approach toward the result is fast than the simple insertion sort. As far as time complexity is concerned both have almost similar performance, but when the cost of comparison is high this method is well suited.

Abstract

Insertion sort, one of the popular sorting methods having average time complexity O(n2), is based on the decrease and conquer strategy. We insert elements one by one in the sorted part and decrease the size of the unsorted portion, instead of a simple comparison method for insertion of elements in the sorted portion if we apply the binary search approach to locate the appropriate position for the inserting element in the sorted part. This will reduce the number of key comparisons; the only problem with this approach is to shift the elements one place to its right which are greater than A[i]. But the convergence of this approach toward the result is fast than the simple insertion sort. As far as time complexity is concerned both have almost similar performance, but when the cost of comparison is high this method is well suited.

Heruntergeladen am 19.10.2025 von https://www.degruyterbrill.com/document/doi/10.1515/9783111229157-010/html
Button zum nach oben scrollen