Answered You can hire a professional tutor to get the answer.

QUESTION

Consider the following problem. The input consists of n skiers with heights p1, p2, . , pn, and n skies with heights s1, s2, . , sn.

Consider the following problem. The input consists of n skiers with heights p1, p2, . . . , pn,and n skies with heights s1, s2, . . . , sn. The problem is to assign each skier a ski to minimize theaverage difference between the height of a skier and his/her ski. Give a greedy algorithm to solve thisminimization problem. Provide pseudocode and state its asymptotic running time. Prove that youralgorithm is correct.

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question