Reinhardt K., Sorting in-place with a worst case complexity of n log n;1:3n+O(log n) comparisons and "n log n+O(1) transports, Proc. of the 3rd International Symposium on Algorithms and Computation, Lecture Notes in Comput. Sci. ,650 Springer-Verlag (1992), pp. 489{498....
1. What is the worst case?We've established in class that the worst case for insertion sort, the one which will cause insert(L, i) to perform the most number of steps is when L[i] < min(L[:i]). In other words, when the element we are trying to insert in the sorted part ...
Having n to the power of two comparisons dominates complexity, and so insertion sort has quadratic running time. Insertion Sort – Best Case Analysis 1. What is the best case? We've established in class that the best case for insertion sort, the one which will cause insert(L, i) to ...
In this paper I developed a Unidirectional Two-Way sorting algorithm, which out beats all other O(n2) sorting algorithms like Bubble sort, Cocktail sort, Selection sort and Insertion sort for average and worst cases. We also give a time complexity analysis of the algorithm. Major limitation of...