Min max improvements

Using lineary complexity instead of quicksort's complexity. (n log2(n) )
Usefull for big arrays.