In the world of computers, algorithms are essentially solutions to a problem or class of problems. That is to say, if we want to use the computer to solve the problem, we must be the problem of the solution of the correct and complete description, and the computer should be able to understand the description. This requires US programmers to translate the entire description into a series of clear instructions that can receive input that satisfies a certain specification and produce the corresponding output in a limited amount of time. We usually refer to these instructions as programs, while algorithms are the soul of the program.
However, it is not enough for the program to have souls. For example, it's true that search algorithms can be used to solve search-class problems, but we don't usually search for searches. All search algorithms when entering the program, have to face some substantive content, such as news information, paper archive, and these content often have specific storage systems, such as databases, file systems. These systems themselves also have their own data structures, trees, lists, etc., so the algorithm is not the only problem we need to consider when writing programs. In many real-world situations, it is not even the main problem.
Therefore, if you use C or C + + for programming teaching, our focus on algorithmic design is easily disturbed by the more basic details of the data structure. After all, using these languages to implement and use a good data structure is inherently complex. Therefore, if you want to focus on algorithmic teaching, you need a programming language that does not require programmers to spend too much time on data structures.
Over a long period of time, we usually use a "pseudo-code" that is closer to human language when designing an algorithm. This code is abstract enough to allow us to focus on the expression of the algorithm, but unfortunately, they cannot be executed on the computer, and we will eventually translate it into a real programming language. It works, but it's obviously not elegant enough. We need a language that is close to these "pseudo-code" at an abstraction level and can be as common as C on a computer. Python is such a language.
This book is a book using Python for algorithmic design teaching, the author of this book in his previous book, "Python Basic Tutorial" has demonstrated its rich teaching experience and technical strength, I also benefited from it. I am honored to be able to translate his follow-up works. But the time and effort required to translate an algorithmic book is far beyond my imagination. And when I translated it for nearly eight months and finally finished translating the 1th edition of the book, its 2nd edition was published. So I had to find two friends (see Translator profile), their job is to re-proofread the 2nd version of the translation, the revision and the final two chapters of the first translation. I am grateful for the help they have given me. In addition, I would like to thank my good friend, "deep analysis of Windows operating System" (6th edition) of the translator Fan Decheng engineer, he participated in the book's proofreading, a rigorous review of the translation, providing a lot of valuable advice.
I wish this book will help the readers, but also hope that you read happiness.
"Python algorithm tutorial" translator sequence