Fox et al. (1988) present a method of compare and exchange in which individual numbers are exchanged between the processors, say P0 and P1. Suppose each processor has four numbers in its group. Processor P0 sends the largest number in its group to processor P1, while processor P1 sends the smallest number of its group to processor P0. Each processor inserts the received number into its group, so that both still have n/p numbers. The actions are repeated with the new largest and smallest numbers. The algorithm is most conveniently implemented using a queue with a pointer to the top or bottom, as illustrated in Figure 10.33.
Figure 10.33
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here