CS 573Homework 3 (due October 18, 2010)Fall 2010CS 573: Graduate Algorithms, Fall 2010Homework 3Due Monday, October 18, 2010 at 5pm(in the homework drop boxes in the basement of Siebel)1.Suppose we are given two arraysC[1..n]andR[1..n]of positive integers. Ann×nmatrix of 0sand 1sagrees withRandCif, for every indexi, theith row containsR[i]1s, and theith columncontainsC[i]1s. Describe and analyze an algorithm that either constructs a matrix that agreeswithRandC, or correctly reports that no such matrix exists.2.Suppose we havenskiers with heights given in an arrayP[1..n], andnskis with heights given inan arrayS[1..n]. Describe an efficient algorithm to assign a ski to each skier, so that the averagedifference between the height of a skier and her assigned ski is as small as possible. The algorithmshould compute a permutationσsuch that the expression1nnXi=1P[i]-S[σ(i)]is as small as possible.
This is the end of the preview.
access the rest of the document.