Computes the mode of an array.