Sorting Networks

Requires a Wolfram Notebook System

Interact on desktop, mobile and cloud with the free Wolfram CDF Player or other Wolfram Language products.

Requires a Wolfram Notebook System

Edit on desktop, mobile and cloud with any Wolfram Language product.

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.

Contributed by: Stephen Wolfram (March 2011)
Open content licensed under CC BY-NC-SA


Snapshots


Details

Not all types of sorting networks exist for every number of elements. Optimal networks are not yet known for more than 16 elements.

For less than 9 elements, there are no unique optimal sorting networks. Here the Batcher method achieves the minimal number of comparators for each case.



Feedback (field required)
Email (field required) Name
Occupation Organization
Note: Your message & contact information may be shared with the author of any specific Demonstration for which you give feedback.
Send