http://www.perlmonks.org?node_id=981890


in reply to Any idea for predicting the peak points in the graph by perl

Not, this is not the right way

What you want probably is to find (to predict) the critic points of the function defined by your sample points. Obtaining the maximum point of the sample is not of much value because what is really interesting in the graph is the curve of the function that fits better your points. Its maximum and minimun points can be (and probably will be) between two given points

You probably need instead

use Math:Derivative;

increase gradually and then decrease gradually

Clearly your teacher was trying to tell you something with this words. A requisite to be able to find what you want is that your function is continuous

EDIT: Well I see now that a lot of the last messages point to this yet. Your problem is a math problem, not a "sort this array" problem