📜 ⬆️ ⬇️

Translation of the online textbook "Problem Solving with Algorithms and Data Structures"

image Hi, Habr!

We (@ali_aliev and avenat ) are pleased to present to your attention a translation of the interactive textbook "Problem Solving with Data Structures" by Brad Miller (Brad Miller) and David Ranum (David Ranum) from Luther College, Iowa, USA.

About what?

The textbook examines, explains and analyzes the most frequently used data structures and algorithms. The presentation goes from simple (what is an algorithm, how to evaluate its performance) to complex (trees, graphs) with live examples and code. Python was chosen as the programming language, and for those who are not familiar with it, in the first chapter there is a large section with its concentrated description.
')
The authors talk about data structures such as stacks, queues (including those with priority), decks, hash tables, lists, trees, and graphs. The last two in general are devoted not quite small chapters. The presentation is not just descriptive: for each structure, an option is offered (and sometimes not one) of its implementation in Python. The emphasis, of course, is on object-oriented programming: a class is created, methods are written to it, some of which the authors leave to the readers for their own improvement. Then there are examples of the use of the considered structure and a description of the algorithms with its participation.

One of the chapters of the textbook is devoted to recursion, including its graphic representation (fractals). Understands several well-known recursive tasks, and at the end clearly demonstrates that this technique, despite its elegance, is by no means a “silver bullet”.

Classical algorithms for sorting and searching are not deprived of attention either. And, of course, for each of them, performance and "pitfalls" are analyzed, as well as recommendations for use are given. In the last chapters on trees and graphs, a lot of material is given about their varieties and related algorithms. The presentation here becomes more concise, many points are simply described so that after reading the chapter, the reader implements them on his own.

For whom?

The textbook is intended primarily for high school students and students, as well as "floating" in the theory of practical programmers. There is a lot of code, and the closer to the last chapters, the less he chews. Therefore, it is worth being prepared for a thoughtful reading of listings. However, the textbook is not for nothing called "interactive." The text contains inserts with the so-called ActiveCode, which can be run directly on the page in order to “feel” the live program. Plus for more complex material there is CodeLens - a sort of debugger in which you can view the work of the code line by line. Most sections have tests for self-examination, and at the end of each chapter there are two sets of tasks for independent work: on theory and on practice.

Technical details

The tutorial is implemented on sphinx using extensions that add interactivity to it (for example, an extension that allows you to execute source Python code in a browser). Like the original project, the translation is open source. All source codes of the book are laid out on github-e . Therefore, if you find a typo, semantic or stylistic mistake, then join! You can also make a clone of the tutorial repository and read it locally. Assembly instructions can be found here .

And once again links

Original: http://interactivepython.org/courselib/static/pythonds/index.html

Translation: http://aliev.me/runestone/

Translation repository on github-e: https://github.com/aliev/runestone

Source: https://habr.com/ru/post/241696/


All Articles