For example I have an array like below:
int[] arrayOne = new int[10]{3,1,29,5,2,4,7,10,38,42};
And below are my method to pick the minimum number from the array
int pickMinNumber (int[] intArray)
{
int result = intArray[0];
for (int i = 0; i < arrayOne.Length; i++)
{
if(intArray[i] < result)
result = intArray[i];
}
return result;
}
Are there any quicker way to pick the minimum number?