First page Back Continue Last page Graphics
Array Sort II (cont.)
Member Functions
- initSwapSequenceWith(int index)
- Received when the receiving chare should perform a swap with the chare at index (used to start the sort, each chare told to check both of its neighbors)
- requestSwap(int reqIndex, int value)
- Received when chare at reqIndex wants to swap values
- denySwap(int index)
- Received in response to requestSwap() call… request is denied
- acceptSwap(int index, int value)
- Received in response to requestSwap() call… request is accepted
- checkForPending()
- Used to check if a request for a swap was received and buffered while the chare was already busy taking care of another swap