1. For the above array A, fill in a the parallel array Count with the value of how many elements in A are less than it. E.g., Count[0] should get 2 since 2 elements in A are less than 50, A[0].

2. How can you use the Count information to create a sorted array, S?

3. What would be the theta notation for filling the Count array?

4. What would be the theta notation for the sort-by-counting algorithm?

2. Calculate M x M.

3. What does M x M represent?

4. Jealous husbands Puzzle (6.6 # 10) There are n married couples who need to cross a river. They have a boat that can hold no more than 2 people at a time. To complicate matters, all the husbands are jealous and will not agree on any crossing procedure that would put a wife on the same bank of the river with another woman's husband without the wife's husband being there too, even if there are other people on the same bank. Can they cross the river under such constraints?

a) Solve the problem for n = 2.

b) Solve the problem for n = 3, which is the classical version of this problem.

c) Does the problem have a solution for every ? If it does, indicate how many river crossings it will take; if it does not, explain why.