Writing purpose

Illustrated Data Structures and Algorithms was written to provide a visual and easy-to-understand way to learn common data structures and algorithms. The book uses a step-by-step diagram to present common concepts in data structures and the steps of algorithms, reducing the difficulty of understanding and reading pressure.

For programmers who don’t write algorithms, what we really need is a visual and easy-to-understand way to learn about data structures and algorithms. For the core ideas of common data structures and algorithms, we prefer to understand them from an emotional perspective, so that we can know what data structures and algorithms to use in different scenarios. The author hopes that the book will help novice programmers and experienced engineers easily understand the essence and ideas of common data structures and algorithms.

What are the data structures and algorithms?

According to Wikipedia, a data structure is a format for organizing, managing, and storing data that provides efficient data access and modification operations. More precisely, a data structure is a collection of data that describes the relationships between data and provides various operations on that data.

An algorithm, on the other hand, is a clearly defined set of instructions used to solve a problem of some kind or perform some kind of computational task. An algorithm should be expressed in limited space and time. It starts with an initial state and input, and after a series of limited and clearly defined instructions, finally produces an output and terminates in a final state.

Encapsulation produces black boxes

Linus Torvalds, the father of the Linux kernel, once said, “I think the difference between a good programmer and a bad one is whether he values data structures more than code. Bad programmers focus on code, while good programmers focus on data structures.” Niklaus Wirth, the father of Pascal and a Turing prize winner, also famously proposed the formula “algorithm + data structure = program”.

With the rise of object-oriented thought, object-oriented programming languages encapsulate many common data structures and algorithms into various objects, such as different kinds of lists, sets, queues, trees and so on. So how exactly do they work? What is the implementation principle? For programming languages, encapsulating commonly used data structures and algorithms has many benefits, such as lower usage costs and greatly reduced coding error rates. But encapsulation also leads to black boxes, where many people don’t know exactly how the object is implemented, leading to misuse.

This book features

Instead of being tied to any specific programming language, the book focuses on the idea of illustrating data structures and algorithms in a graphical way, so it’s easy to read whether you’re a front-end or back-end programmer, and whether you’re using Javascript, Java, C++, or Python.

The goal of this book is to enable readers to easily understand and master commonly used data structures and algorithms from an emotional perspective. Instead of complex academic statements, the book is explained in an easy-to-understand way, and the core ideas can be understood by following the implementation of schematic diagrams.

The data structures and algorithms explained in this book are the most common ones in our projects, so this book can help us understand the relevant implementation principles in actual project development.

Actual renderings