Math Fundamentals18 sections · 814 units
Open in Course

Problem - Find Maximum

(Analyzing linear scan)

You are given an array of integers. Return the largest value.

This is the simplest linear-time problem. You cannot do better than O(n) because every element could be the answer. Before solving, think about what operations happen inside the loop.