Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In a galaxy far, far away, the Empire has built n Death Satellites to attack n planets controlled by the rebels (each satellite will attack

In a galaxy far, far away, the Empire has built n 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. The i-th satellite has power fi , while the shield on planet j can tolerate up to sj power. A successful attack on the i-th planet brings benefit bi to the Empire. That is, if planet i is attacked by the j-th satellite and fj > si , then the Empire will receive benefit bi ; otherwise, it will receive benefit 0. Match satellites to planets to maximize the Empires benefit in O(n log n) time, using a greedy algorithm.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database Technology

Authors: Suad Alagic

1st Edition

354096276X, 978-3540962762

More Books

Students also viewed these Databases questions

Question

3. Existing organizations and programs constrain behavior.

Answered: 1 week ago