June 2021
Beginner
336 pages
7h 11m
English

An algorithm is a sequence of steps that solves a problem. For each problem in this book, we solved it by writing an algorithm in the form of Python code. We’ll focus in this chapter on designing algorithms. When faced with a new problem, sometimes it’s hard to know what to do to solve it. What algorithm should we write? Fortunately, we don’t need to start from scratch each time. Computer scientists and programmers have identified several general types of algorithms, and it’s likely that at least one of them can be used to solve our problem.
One type of algorithm is called a complete search algorithm; ...