Give the exact number of element-wise comparisons needed tofind both the smallest and the largest elements in an array of n un-sortedelements. Give the exact number of element-wise comparisons needed tofind both the smallest and the second smallest elements in an array of n un-sortedelements. Note that you are not supposed to use asymptotic notations to answer these questions. Give the exact number of element-wise comparisons needed tofind both the smallest and the largest elements in an array of n un-sortedelements. Give the exact number of element-wise comparisons needed tofind both the smallest and the second smallest elements in an array of n un-sortedelements. Note that you are not supposed to use asymptotic notations to answer these questions.
Explanation / Answer
also in same number of comparrisions largest element can befind.