Question: You are given two sequences A and B, each containing n positive integers. You can reorder each set in whatever way you want. After reordering,

 You are given two sequences A and B, each containing n

You are given two sequences A and B, each containing n positive integers. You can reorder each set in whatever way you want. After reordering, let aibe the i-th element of sequence A and let bi be the i-th element of sequence B. You then receive a payoff of -1 ad dollars. Give a greedy algorithm to maximize your payoff. Prove that your algorithm is correct and analyze its running time

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!