WOLFRAM|DEMONSTRATIONS PROJECT

Sorting Networks

​
sorting algorithm
transposition
insertion
pairwise
Batcher
optimal
number of elements
test input
none
reversed
random
cycle input
new random input
16 elements 63 comparisons
Starting from the left, a sorting network does a sequence of comparisons, interchanging elements if they are out of order. The network is set up so that by the time the data reaches the right-hand end, all the elements are sorted. Notice that better sorting networks tend to look more complex.