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.

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

```
package main
/*
* Odd-Even sort - https://en.wikipedia.org/wiki/Odd-even_sort
*/
func OddEvenSort(arr []int) {
tmp, isSorted := 0, false
for isSorted == false {
isSorted = true
for i := 1; i < len(arr) - 1; i = i + 2 {
if arr[i] > arr[i + 1] {
tmp = arr[i]
arr[i] = arr[i + 1]
arr[i + 1] = tmp
isSorted = false
}
}
for i := 0; i < len(arr) - 1; i = i + 2 {
if arr[i] > arr[i + 1] {
tmp = arr[i]
arr[i] = arr[i + 1]
arr[i + 1] = tmp
isSorted = false
}
}
}
}
```