Math Fundamentals18 sections · 814 units
Open in Course

Find Maximum - Insight

(Single pass suffices)

You need one variable to track the current maximum. Walk through the array once. If you find something bigger, update the max.

No sorting. No extra storage. Just comparison and assignment inside a loop.

This is classic O(n): every element visited exactly once.