Menu

[Solved]10 Points N Trading Posts Along River Numbered 1 N Travel Downstream Trading Post Rent Can Q37196549

(10 points) There are n trading posts along a river, numbered 1to n as you travel downstream. At any trading post i you can rent acanoe to be returned at any of the downstream trading posts j,where j ≥ i.
You are given a table R[i, j] defining the cost of a canoe which ispicked up at post i and dropped off at post j for 1 ≤ i ≤ j ≤ n.Assume that R[i, i] = 0 and that you can’t take a canoe upriver (soperhaps R[i, j] = ∞ when i > j). However, it can happen that thecost of renting from i to j is higher than the total cost of aseries of shorter rentals. In this case, you can return the firstcanoe at some post k between i and j and continue your journey in asecond (and maybe third, fourth …) canoe.

There is no extra charge for changing canoes this way. Describean efficient algorithm to determine the minimum cost of a trip bycanoe from each possible departure point i to each possible arrivalpoint j. Analyze the running time of your algorithm.

Expert Answer


Answer to (10 points) There are n trading posts along a river, numbered 1 to n as you travel downstream. At any trading post i you… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *