Two Way Insertion Sort Modification Simple Insertion Sort Follows Seperate Output Array Si Q10189187

The two way insertion sort is a modification of the simpleinsertion sort as follows: A seperate output array of size n is setaside. This output array actas as a circular structure as insection 4.1. x[0] is placed into the middle element of the array.Once a contiguous group of elements are in the array, room for anew element is made by shifting all smaller elements one strep tothe left or all larger elements one step to the right. The choiceof which shift to perform depends on which would cause the smallestamount of shifting.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *