A ski rental agency has n pairs of skis, where the height of the the ipair of skis is s; . There are n skiers who wish to rent skis, where the height of the ith skier is. h;. Ideally, each skier...


A ski rental agency has n pairs of skis, where the height of the the ipair of skis is s; . There<br>are n skiers who wish to rent skis, where the height of the ith skier is. h;. Ideally, each skier<br>should obtain a pair of skis whose height matches her/his own height as closely as possible. We<br>would like to assign skis to skiers so that the sum of the absolute differences of the heights of<br>each skier and her/his skis is minimized. Design a greedy algorithm for the problem. Prove the<br>correctness of your algorithm.<br>(Hint: Start with two skis and two skiers. How would you match them? Continue to three skis<br>and three skiers, and identify a strategy.)<br>

Extracted text: A ski rental agency has n pairs of skis, where the height of the the ipair of skis is s; . There are n skiers who wish to rent skis, where the height of the ith skier is. h;. Ideally, each skier should obtain a pair of skis whose height matches her/his own height as closely as possible. We would like to assign skis to skiers so that the sum of the absolute differences of the heights of each skier and her/his skis is minimized. Design a greedy algorithm for the problem. Prove the correctness of your algorithm. (Hint: Start with two skis and two skiers. How would you match them? Continue to three skis and three skiers, and identify a strategy.)

Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here