odd even sort Algorithm

In computing, an odd – even sort or odd – even transposition sort (also known as brick sort or parity sort) is a relatively simple sorting algorithm, developed originally for purpose on parallel CPUs with local interconnections. It is a comparison sort associated to bubble sort, with which it shares many characteristics.

odd even sort source code, pseudocode and analysis

The individual-CPU algorithm, like bubblesort, is simple but not very efficient. Here a zero-based index is assumed: