Question: Suppose you are given two sets A and B, each containing n positive integers. You can choose to reorder each set however you like. After

Suppose you are given two sets A and B, each containing n positive integers. You can choose to reorder each set however you like. After reordering, let ai be the ith element of set A, and let bi be the ith element of set B. You then receive a payoff of. Give an algorithm that will maximize your payoff. Prove that your algorithm maximizes the payoff, and state its running time.

Step by Step Solution

3.22 Rating (169 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Sort A and B into monotonically decreasing order Heres a proof that this m... View full answer

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

Document Format (1 attachment)

Word file Icon

C-S-A (118).docx

120 KBs Word File

Students Have Also Explored These Related Algorithms Questions!