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 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
Get step-by-step solutions from verified subject matter experts
