in reply to Re: finding local minima/maxima for a discrete array
in thread finding local minima/maxima for a discrete array
That's a little oversimplified. In the case of 1 2 2 1, 2 is a local maximum. In 3 2 2 3, 2 is a local minimum. In 1 2 2 3, it's neither. You can't tell them apart just looking at the adjacent elements.