Batcher’s odd and even merge sort
If you have a list of keys arranged from left to right, and you sort the
left and right halves of the list separately, and then sort the keys in
even positions on the list, and in odd positions separately, then all
you need do is compare and switch each even position key
(counting from the left) with the odd position key immediately to its
right, and you will have completely sorted the whole list. The
algorithm can be summarized as follows: Sort Algorithm for 2m
keys = Sort left half and Sort right half; Then Merge the two halves,
and can describe the Merge step as Merge 2m keys = Merge m odd
keys and m even keys. Then compare and switch each even key
with odd key to its right.