Here in the given code we are mainly finding the maximum and minimum number of the array by reading the whole array element by element and comparing each element with two variables max=0 and min=0 if array element>max array element is equal to max and array element<min array element is equal to min in this way we found out minimum and maximum value in the array.
Proposed Changes:
Basically in the optimized solution i am use a pointer max_element(arr,arr+lenghtofarr) which points to the max valued element in the array and then we use the pointer min_element(arr,arr+lenghtofarr) which points to the min value element of the array , therteby satisfying the inbuilt function need.
Thereby, I request @Illuminati9 to assign this issue to me.
Issue Type: Optimize Solution
Description:
Here in the given code we are mainly finding the maximum and minimum number of the array by reading the whole array element by element and comparing each element with two variables max=0 and min=0 if array element>max array element is equal to max and array element<min array element is equal to min in this way we found out minimum and maximum value in the array.
Proposed Changes:
Basically in the optimized solution i am use a pointer max_element(arr,arr+lenghtofarr) which points to the max valued element in the array and then we use the pointer min_element(arr,arr+lenghtofarr) which points to the min value element of the array , therteby satisfying the inbuilt function need.
Thereby, I request @Illuminati9 to assign this issue to me.