I have no idea what you are talking about sorting for. However the easiest way to do this is the following.

If the array is NULL,{ throw an exception.}Set min to be the first element in the array.For each element in the array,{ if the element is less than min, { set min to the element's value }}.Print out min.

Is this what you mean, I am not soring at all and this will give the minimum value of the array.

Code is now indented for clarification although apparently changes cannot be seen. As a workaround, I added braces.