Find local min and local max from dataset

266 Views Asked by At

I have a collection of data consists of TIME and TEMPERATURE as follow:

(time1, temp1), (time2, temp2), (time3, temp3), ... (time-n temp-n).

I cannot come up with a good computer algorithm to find the local min(s) and local max(s). Not sure what is the best approach here.

1

There are 1 best solutions below

0
On

How about if (temp1 > temp2 and temp2 < temp3) then temp2 is a local minimum?