next up previous

Exercise 5: A consideration of the cost involved in an algorithm and a slight variation of the algorithm.

Show how to reduce the number of messages sent in the first two loops of the algorithm by sometimes shifting right (down) instead of left (up). How does this reduce the overall cost?