Unit 1 - Lesson 17 - Standard Algorithms - Find Minimum

19/08/2025 15 min Temporada 1 Episodio 18
Unit 1 - Lesson 17 - Standard Algorithms - Find Minimum

Listen "Unit 1 - Lesson 17 - Standard Algorithms - Find Minimum"

Episode Synopsis

Welcome back to our series on Standard Algorithms! Today, we're covering Period 17: Find Minimum. Our main goal is to help you implement the "Find Minimum" standard algorithm.The "Find Minimum" AlgorithmWe'll start by defining the "Find Minimum" algorithm. This algorithm is designed to find the smallest value in an array of numbers. Its logic is very similar to the "Find Maximum" algorithm we covered last time. The core idea is to assume the first number is the smallest and then loop through the rest of the array, updating your "minimum" value whenever you find a smaller number.We'll review the example code for "Finding Minimum number in an array" and highlight the subtle but important differences from the "Find Maximum" code. We'll show how a single line change—from a greater-than symbol (>) to a less-than symbol (<)—is often all it takes to switch from finding a maximum to finding a minimum.Hands-on Practice & Assessment ✍️You'll get hands-on experience by typing up and testing the provided "Find Minimum" example code. Then, you'll apply this algorithm to two tasks from your booklets: Task 9, Problem 1d from "Software Design and Development Booklet v1.4.pdf" and Task 1b from "Kings Park Booklet.pdf". These tasks will give you a chance to implement the algorithm on your own datasets.For those looking for a challenge, we'll encourage you to write a single function that can find both the minimum and maximum value in an array. This function would take an argument to determine which operation to perform. By the end of this episode, you'll not only be able to find the minimum value in any array but also appreciate the elegant symmetry between these two algorithms.