"I assume here that the elements are approximately evenly distributed real numbers, although the algorithm can be adapted to other types of data." . . . .