compute_min_max function

Compute minimum and maximum