194 PARALLEL ALGORITHMS
You can see in Fig. 7.4 that this process takes 16 parallel steps to sort these
numbers and 1 step to write the results. In general, this process will take 2 *
(N 1) + 1, or O(N), run time. Because there are N processors the cost of
this sort is O(N^2 ), which is the same as our slower sorts.E17 1312 1518P 1 P 2 P 3 P 4 P 5 P 6 P 7 P 8 P 9F11 17 15P 1 P 2 P 3 P 4 P 5 P 6 P 7 P 8 P 9G19 12 17 18P 1 P 2 P 3 P 4 P 5 P 6 P 7 P 8 P 9H161111 13 1512 13 1812 15 1819 13 17P 1 P 2 P 3 P 4 P 5 P 6 P 7 P 8 P 9I1411 12 13 1716 19 15 18P 1 P 2 P 3 P 4 P 5 P 6 P 7 P 8 P 9J 11 12 13 15 1814 16 19 17P 1 P 2 P 3 P 4 P 5 P 6 P 7 P 8 P 9K 11 12 13 15 1714 16 19 18P 1 P 2 P 3 P 4 P 5 P 6 P 7 P 8 P 9
■FIGURE 7.4B
A linear parallel
network sort