UNit 1 - Lesson 16 - Find Maximum

19/08/2025 14 min Temporada 1 Episodio 17
UNit 1 - Lesson 16 - Find Maximum

Listen "UNit 1 - Lesson 16 - Find Maximum"

Episode Synopsis

Welcome to our series on Standard Algorithms! Today, we're covering Period 16: Find Maximum. Our main goal is to help you implement the "Find Maximum" standard algorithm.The "Find Maximum" Algorithm 📈We'll start by defining the "Find Maximum" algorithm and explaining its logic. This algorithm is designed to find the largest value within an array of numbers. The core idea is simple: you start with an initial assumption that the first number is the biggest. Then, you loop through the rest of the array, comparing each number to your current "maximum." If you find a number that's bigger, you update your "maximum" to that new value. By the time you've checked every number, your "maximum" variable will hold the largest value in the entire array.We'll review the example code for "Finding Maximum number in an array," and we'll pay close attention to the crucial first step: initialising the maxNo variable correctly.This step is vital to ensure the algorithm works as intended, and we'll provide guidance on how to avoid common mistakes.