while loop, and compute remainders with %. It also assumes you have seen Euclid's algorithm for the greatest common divisor (GCD), which runs through the whole tutorial.7 min readVideo lecture% in Python, mod in pseudocode). It builds on the definition of an algorithm and its properties from the previous chapters.6 min readVideo lecture%), and already know the difference between a problem, an algorithm and a program from the previous chapter. In this chapter you will write down exactly what problem an algorithm is meant to solve, before yo5 min readVideo lecturea % b is the remainder when a is divided by b. It also assumes you have met the five properties of an algorithm and know how to write a specification with inputs, outputs, preconditions and postconditions. Here you will turn a speci7 min readVideo lectureif, while and for do in at least one language, and that you have seen Euclid's algorithm described in plain language earlier in this tutorial. The goal here is to look at those familiar constructs as a description language: a 6 min readVideo lecturemod, written % in Python). It also assumes you have seen Euclid's algorithm written as numbered plain-language steps, and that you know the three buil7 min readVideo lecturemod in pseudocode, % in Python). You have already seen Euclid's algorithm written in plain language, pseudocode and Pyt6 min readfind_max and Euclid's gcd examples from earlier chapters. You will learn to estimate how much work an algorithm does by counting basic steps, and to state that estimate in 6 min readVideo lecture12 chapters have a video lecture. Each plays at the top of its chapter.
Published YouTube: watch What Is an Algorithm? (opens in a new tab)
Published YouTube: watch The Properties Every Algorithm Must Have (opens in a new tab)
Published YouTube: watch Problems, Algorithms and Programs Are Different Things (opens in a new tab)
Published YouTube: watch Stating the Problem Precisely: Inputs, Outputs and Conditions (opens in a new tab)
Published YouTube: watch Writing Steps in Plain Language (opens in a new tab)
Published YouTube: watch The Three Building Blocks: Sequence, Selection, Iteration (opens in a new tab)
Published YouTube: watch Describing Algorithms with Pseudocode (opens in a new tab)
Published YouTube: watch Drawing Algorithms as Flowcharts (opens in a new tab)
Published YouTube: watch Does It Solve the Problem? Checking Correctness (opens in a new tab)
Published YouTube: watch Loop Invariants as a Correctness Tool (opens in a new tab)
Published YouTube: watch Describing Algorithms Recursively (opens in a new tab)
Published YouTube: watch How Much Work? Counting Steps and Big-O (opens in a new tab)