The art of computer programming, volume 3: (2nd ed.) sorting and searching
The art of computer programming, volume 3: (2nd ed.) sorting and searching
Hi-index | 0.00 |
Consider a compare-swap operation that compares and possibly swaps the values of its two operands (a, b), so that we obtain a pair (a, b) satisfying a ≤ b after execution. A sorting network is a sequence of compare-swap operations that depends only on the number of elements to be sorted [1]. Let's call the compare-swap operation as a comparator. An advantage of sorting networks against the classical sorting algorithms is that the number of comparators is fixed for a given number of inputs. Thus they can be easily implemented in hardware. Figure 1 shows an example of a three-input sorting network and its alternative symbol.