Skip to content

cs-studies/algorithms-common-sense

Repository files navigation

“Any code that does anything at all is technically an algorithm–it’s a particular process for solving a problem.”

“… everything about data structures and algorithms boils down to common sense.”

— Jay Wengrow, A Common-Sense Guide to Data Structures and Algorithms

Contents Highlights

What

This repository contains code illustrations written while reading the book A Common-Sense Guide to Data Structures and Algorithms, Second Edition by Jay Wengrow.

This is an introductory book to algorithms and data structures. It is suitable for beginners in programming and computer science. Notably contrasting with most of the books on the topic, it doesn’t require advanced mathematics knowledge. (For instance, the author even shortly explains what the terms of the school-level math exponent and logarithm mean.)

At the same time, code examples in it are provided in different programming languages, which the same beginners may find not convenient to use in practice. Thus…

How

With the aforementioned in mind, the code illustrations in this repository are aimed to be written in a foundational manner, sometimes at a cost of being not the most efficient or fully idiomatic code (the same strategy, naturally, was chosen by the author of the book). It was also attempted to follow the book’s structure and contents closely, to simplify the usage of the samples alongside reading the book.

All the code illustrations are implemented in the Rust programming language. From time to time, digressions examining the Rust language capabilities – essential or in some way interesting – are allowed to slip into this repository. Such excursions are marked with the “Rust Extras” comment.

For an introduction to the language, it’s recommended to start with The Rust Programming Language (a.k.a. The Book).

Why

The choice of the programming language was influenced by several factors, mostly because Rust is:

  • a low-level language, potentially convenient for programming concepts investigation;
  • a modern language, with many accompanying tools provided out-of-the-box;
  • famously memory-safe (helps to write less error-prone code);
  • quite easy to grasp for basic usage;
  • subjectively pleasant to use.

Have Fun!