Lecture18
Lecture18
bitonic
bitonic
cleaner.
clean
1 0 1 1
n Each half-cleaner is a comparison network of 0 0
bitonic
bitonic
1 1
depth 1 in which input line i is compared with 1 1 1 1
bitonic
bitonic
0 0 1 1
clean
n When a bitonic sequence of 0’s and 1’s is 0 1 1 1
applied as input to a half-cleaner, the half- 0 1 0 1
cleaner produces an output sequence in
which smaller values are in the top half,
larger values are in the bottom half, and both
halves are bitonic.
1
The bitonic sorter
n By recursively combining half-cleaners we A Merging Network
can build a bitonic sorter, which is a network
that sorts bitonic sequences.
n The first stage of bitonic-sorter[n] is half- n Our sorting network will be constructed
cleaner[n] , which produces two bitonic from merging networks, which are
sequences. networks that can merge two sorted
n Thus we can complete the sort by using two sequences into one sorted output
copies of bitonic-sorter[n/2]
sequence.
n We modify the first half cleaner in the
Bitonic-sorter[n]
Bitonic
sorter
1 22 3 4444 55 6