Question: 1. (a) You are given two inputs: an integer k and an array A of n distinct integers. Give an algorithm to find any one

1. (a) You are given two inputs: an integer k and an array A of n distinct integers. Give an algorithm to find any one of the k smallest elements of A using at most n - k comparisons. (b) Explain why your algorithm is guaranteed to find a correct answer. (c) Professor F. Lake claims he has an algorithm that uses strictly fewer than n k comparisons to solve this problem. Do you believe his claim? Either explain why you think it's possible or explain why you think no such algorithm can exist
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
