DSC-IIITL / GitGrind

9 stars 58 forks source link

to create an issue for providing optimized solution of minandmax.cpp programme #38

Closed blunterdecosta123 closed 9 months ago

blunterdecosta123 commented 9 months ago

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.