9DESIGNING ALGORITHMS WITH COMPLETE SEARCH

image

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; ...

Get Learn to Code by Solving Problems now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.