An introduction to algorithms for readers with no background in advanced mathematics or computer science, emphasizing examples and real-world problems. Algorithms are what we do in order not to have to do something. Algorithms consist of instructions to carry out tasks—usually dull, repetitive ones. Starting from simple building blocks, computer algorithms enable machines to recognize and produce speech, translate texts, categorize and summarize documents, describe images, and predict the weather. A task that would take hours can be completed in virtually no time by using a few lines of code in a modern scripting program. This book offers an introduction to algorithms through the real-world problems they solve. The algorithms are presented in pseudocode and can readily be implemented in a computer language. The book presents algorithms simply and accessibly, without overwhelming readers or insulting their intelligence. Readers should be comfortable with mathematical fundamentals and have a basic understanding of how computers work; all other necessary concepts are explained in the text. After presenting background in pseudocode conventions, basic terminology, and data structures, chapters cover compression, cryptography, graphs, searching and sorting, hashing, classification, strings, and chance. Each chapter describes real problems and then presents algorithms to solve them. Examples illustrate the wide range of applications, including shortest paths as a solution to paragraph line breaks, strongest paths in elections systems, hashes for song recognition, voting power Monte Carlo methods, and entropy for machine learning. Real-World Algorithms can be used by students in disciplines from economics to applied sciences. Computer science majors can read it before using a more technical text.
Panos Louridas is Associate Professor in the Department of Management Science and Technology at the Athens University of Economics and Business. He is the author of Real World Algorithms: A Beginner's Guide (MIT Press).
Если вы решили читать эту книгу в редакции «Бомборы», то будет не лишним знать, что на гитхабе автора лежит 18-страничная эррата довольно грубых опечаток. Не смотря на то, что большая часть ошибок датирована 2017-м годом, кажется, ни одна из них не была принята во внимание в подготовке русскоязычного издания 2018 года — и, наоборот, случайных ошибок и опечаток в этом издании только прибавилось.
Редкая книга, которую я не только перестал читать на середине, но и выбросил, чтобы она случайно не досталось кому-нибудь еще. Каким-то максимально талантливым образом автор умудряется усложнять элементарные вещи, а сложные — превращать в зубодробительные простыни переусложненных абстракций и не самых очевидных эвристик. Когда вследствие авторской, редакторской или переводческой ошибки в этот блок текста вкрадывается еще и случайная опечатка, то задача работы с этим курсом «для начинающих» становится практически бессмысленной — если ломать голову, то лучше над Кнутом. Лоуридасом могли руководить сколько угодно благие намерения, но такие книги для «начинающих» не приносят ничего кроме откровенного вреда.
Первая же глава книги берется объяснять алгоритм на примере курсов акций и открывается таким предложением: «Разница стоимостей акций в конкретный день — это число следующих друг за другом дней, от выбранного нами и в обратном направлении, до того дня, в который стоимость была меньше или равна стоимости в выбранный нами день». Даже если у вас нет сложностей с подобными конструкциями, вы с легкостью найдете своему времени куда более достойные области применения.