Question

You are considering opening a series of ice cream shops along a long, straight beach. There...

You are considering opening a series of ice cream shops along a long, straight beach. There are n potential locations where you could open a shop, and the distance of these locations from the start of the beach are, in meters and in increasing order, d1, d2, d3, ...., dn; you may assume all of the di are integers. The constraints are as follows: • At each location you may open at most one ice cream shop. • The expected profit from opening an ice cream shop at location i is pi , where pi > 0 and i = 1, 2, 3, ..., n. • Any two ice cream shops should be at least x meters apart, where x is a positive integer. Give an efficient algorithm to compute the maximum expected total profit subject to these constraints.

For this question, please define any subproblems (example: C(i,j) is the cost of multiplying matrices Ai...Aj) you are using, state the Recurrence for the entries including all base cases (and explain why it's a correct recurrence relation), give the pseudocode for the alg, and analyze its Running time.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Let us assume that A[i] => expected maximum profit This is obtained by opening some locations for I then A[1]-pi wherej -> ma

Add a comment
Know the answer?
Add Answer to:
You are considering opening a series of ice cream shops along a long, straight beach. There...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT