Question: Problem 3. (25 points) Assume that you are given two arrays A = {ai, a2, ,4) and B = {bi, ba .. , b.) of
Problem 3. (25 points) Assume that you are given two arrays A = {ai, a2, ,4) and B = {bi, ba .. , b.) of n real numbers. 1. Describe a greedy algorithm to determine an ordering of the elements of A and B such that W = , lai-bil is minimized 2. Analyze the time commplexity of your algorithm 3. State and prove the greedy-choice property of your algorithm 4. State and prove the optimal substructure property of your algorithm Hint: consider using the following fact. Given real numbers F 2 and S v2: then
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
