Finding the minimum and maximum element in an array
Welcome file Problem Statement :- Finding the minimum and maximum element in a given array Example 1: We will be given an array and we need to output two space separated integers. First integer should be the minimum number in the array and the second interger should be the maximum number in the array. Input: {15, 1, -9, 76, 28, 1} Output: -9 76 Explanation: -9 is the smallest integer and 76 is the largest integer in the given array. Solution:- The above problem can be solved in multiple ways, but I will be discussing two basic approaches to solve the problem. Using Sorting:- In this method, we need to sort the array first. Let’s say we have sorted the array in ascending order. This means that the first element of the array will now be the minimum element and the last element in the array would be maximum element. The solution is easy to implement and really easy to understand as well, but the only issue that we might face during the interview will be it...