Question: CLAFLIN UNIVERSITY CscI 237 DATA STRUCTURES AND ALGORITHMS TEST 3- FALL 2017 (Q1, Q2,03,04 each 25 points) 4 Consider two sums, x = X1 +

 CLAFLIN UNIVERSITY CscI 237 DATA STRUCTURES AND ALGORITHMS TEST 3- FALL

CLAFLIN UNIVERSITY CscI 237 DATA STRUCTURES AND ALGORITHMS TEST 3- FALL 2017 (Q1, Q2,03,04 each 25 points) 4 Consider two sums, x = X1 + X2 ++ xn and Y = y1 +Y2 + . . ty'm. Give an algorithm that finds (cos) indices i and j such that swapping x, with y, makes the two sums equal, that is, X-x yY -y+ X, if they exist. Analyze your algorithm. (You can use sorting as a subroutine. The amount of credit depends on the correctness of the analysis and the run-time of your algorithm

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!