Zero-one sorting on the mesh
Danny Kriz̧anc, Lata Narayanan · 2002
We consider the problem of sorting an input of size n/sup 2/ with keys restricted to the set {0,1} on a n /spl times/ n mesh-connected computer. We present a deterministic algorithm that runs in 2.25n + o(n) steps, requires small constant size queues and sorts to row major order. This is a significant improvement over the best previously known deterministic algorithm for (general) sorting which requires 3.5n + o(n) steps in this case (M. Kunde, 1990). We also present a randomized algorithm that sorts to an arbitrary indexing scheme, using constant size queues, requiring 2.5n + o(n) steps with high probability. The best previous (randomized) algorithm for this problem runs in 4n + o(n) steps. The problem has applications in divide-and-conquer algorithms and to "packing" problems.>