problemset6 solutions

The smallest value is in the column the next smallest

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: · ½µ ½. Thus, we can apply the inductive assumption to get ½ ´ ·½µ ½ and ½ ´ ·½µ ½ Ñ Ü ´ ½ ´ · ½µ ½ µ . If instead ½ ´ · ½µ ½ , then ½ ½ . Thus, the inductive assump. tion gives us ½ ½ Ñ Ü ´ ½ ´ · ½µ ½ µ ´ · ½µ Case 5 Suppose that but · ½. Similar to case 4. · ½ but · ½. Similar to case 3. Case 6 Suppose that Problem 6-3. Give an algorithm for sorting Æ ¿ elements on an Æ ¢ Æ ¢ Æ mesh in Ç´Æ µ time. Solution: We label each of the processors in the mesh according to ÜÝÞ coordinates. We sort such that Æ ¾ smallest µ for all ½ Æ . The next Æ ¾ smallest values are in values are stored in the plane containing processors ´½ Handout 14: Solution Set 6 3 the plane ´¾ µ, and so on. The Æ smallest value is in the column ´½ ½ µ, the next Æ smallest are in the column µ, and so on. Finally, the smallest value is in ´½ ½ ½µ. Essentially, we are sorting lexicographically. For any ¼ , then the value stored in Ô is less than that in Ô ¼ . If ¼ but µ and Ô ¼ ´ ¼ ¼ ¼ µ, if two processors Ô ´ ¼ , then the value stored in Ô is less than that in Ô ¼ . Similarly, if ¼, ¼ , and ¼ , then the value stored in Ô is less than that in Ô¼ . ´½ ¾ Our algorithm proceeds in several steps: 1.Sort the values in every ÜÞ -plane (an ÜÞ -plane is the set of processors, with fixed Ý , Æ ). 2.Sort the values in every ÜÝ -plane (an ÜÝ -plane is the set of processors, with fixed Þ , Æ ). ´ ´ Ý µ½ Æ ½ Þµ ½ Æ ½ 3.Sort t...
View Full Document

Ask a homework question - tutors are online