How to find minimum and maximum from the double array

gkumar

Active Member
Licensed User
Longtime User
How can I quickly find Min and Max from the double array instead of iterating through all the elements of the array?
 
Here is one way to do it:
Code:
Dim z , y As Double
Dim x() As Double
x=Array As Double(102,61,87.5,111.6,54,43,236.3)
Dim MyList As List
MyList.Initialize
MyList.AddAll(x)
MyList.Sort(True)
y= MyList.Get(0)
z=MyList.Get(MyList.Size-1)
Msgbox("Min: " & y & CRLF & "Max: " & z,"Min and max")
 
Upvote 0
Back
Top