Our FREE site is mostly funded by the Amazon ads ⇓below⇓.
Support us by clicking ⇑above⇑ next time you plan to buy a product on Amazon.
This is a non-parallelized implementation of odd-even transpostiion sort.
Normally the swaps in each set happen simultaneously, without that the algorithm
is no better than bubble sort.
for i in range(0, len(arr)):
for i in range(i % 2, len(arr) - 1, 2):
if arr[i + 1] < arr[i]:
arr[i], arr[i + 1] = arr[i + 1], arr[i]
# creates a list and sorts it
list = 
for i in range(10, 0, -1):
list = OddEvenTransposition(list)
if __name__ == "__main__":