Computes quantiles for an array of values.