In this section we present a randomized algorithm for sorting packets on an
-node butterfly network in
steps using constant-size queues. The algorithm is based on the
Flashsort algorithm of Reif and Valiant [32]. The main
difference is that we use the algorithm for scheduling packets on
leveled networks in place of their scheduling algorithm, which
requires queues of size
. A similar approach has been
suggested previously by Pippenger [26].