Question: *Can this code be in programming language C. Thank you. The two way insertion sort is a modification of your simple insertion sort. Suppose you
*Can this code be in programming language C. Thank you.

The two way insertion sort is a modification of your simple insertion sort. Suppose you are sorting the array x. A separate output array of size 2n + 1 is set aside. Initially x [0] is placed into the middle element of the array n. Continue inserting elements until you need to insert between a pair of elements in the array. As before you need to make room for the new element by shifting elements. Unlike before, you can choose to shift all smaller elements one step to the left or all larger elements one step to the right since there is additional room on both sides of the array. The choice of which shift to perform depends on which would require shifting the smallest amount of elements. Your program must output the total # of assignments performed in your sorting function from insertion and array element shifting (don't worry about assignments like control variable updates in loops, etc). This # will be used in problem #4 below. Include this # in the written document portion of your assignment submission. It can be something simple like: Problem 3: # of sorting assignments = You should also print out the sorted array to confirm that the data was correctly sorted
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
