Question: 1. algorithm 2. proof of correctness. 1 Star Wars In a galaxy far, far away, the Empire has builtn Death Satellites to attack n planets

 1. algorithm 2. proof of correctness. 1 Star Wars In a

1. algorithm

2. proof of correctness.

1 Star Wars In a galaxy far, far away, the Empire has builtn Death Satellites to attack n planets controlled by the rebels (each satellite will attack exactly one planet). The Rebels have installed a defensive shield in each planet. Thei-th satellite has power fi, while the shield on planet j can tolerate up to si power. A successful attack on the i-th planet brings benefit b to the Empire. That is, if planet is attacked by the j-th satellite and fi > Si, then the Empire will receive benefit bi; otherwise, it will receive benefit 0. Match satellites to planets to maximize the Empire's benefit in O (n logn) time, using a greedy algorithm. Hint: Make one or more heaps

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!