Question: 3. In the SELECTION algorithm we studied in class, the input numbers are divided into groups of five. Will the algorithm still work in linear

 3. In the SELECTION algorithm we studied in class, the input

3. In the SELECTION algorithm we studied in class, the input numbers are divided into groups of five. Will the algorithm still work in linear time if they are divided into groups of seven? Explain your answer. (20 points) 4. Let A. n] be an array of n numbers and let M be another number. Design an O(n) time algorithm to find the largest number x of A such that the sum of all numbers of A less than x is at most M, i.e., aEA,a a M. For simplicity, you may assume no two numbers in A are equal. (20 points)

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!