Assuming the signal is relatively clean.....but even if it is not, then have a code that stores two particular values A and B. Give both values an initial starting value.......and that starting value can be the very first measurement gathered by the analog pin.
For future samples of the analog signal, compare your two values against each future sample.
If the most recent sample is less than or equal to the existing value stored in "A", then make the most recent sample equal to the new "A".
If the most recent sample is greater or equal to the existing value stored in "B", then make the most recent sample equal to the new "B".
In the end.... "A" will hold an estimate of the smallest value. While "B" will hold an estimate of the highest value.
Every once in a while, you might need to run the same algorithm using two other variables, eg. "C" and "D" ---- in case your sine-wave changes amplitude levels. This is assuming a 'DC-offsetted' sinusoidal signal.
Alternatively, you could use some hardware to convert the sine-wave to a square-wave, from which you could calculate the period of the sinewave (using timers). Then.....whenever a sinewave zero-crossing occurs, you could probably make the processor wait for one-quarter period. This means wait 1/4 period after a zero-crossing, and then take a sample to measure an instantaneous value of the sine-wave....which will either be a max value or a min value. Because one-quarter period after a zero-crossing gets you to a min or max.