Algorithms and Data Structures in Rust
300 pages
English
PDF
4.5

Algorithms and Data Structures in Rust

Algorithms and Data Structures in Rust

Author:

Year:

Summary:

The book "Algorithms and Data Structures in Rust" is a practical guide that combines fundamental Computer Science concepts with the modern capabilities of the Rust language. The author, Maxim Voronov, an experienced systems software developer, shows how to use strong typing, ownership, and the borrowing system to create efficient and safe algorithms.



Who is this book for?

  • Rust developers looking to deepen their knowledge of algorithms.
  • Students and teachers studying data structures in the context of modern languages.
  • Engineers transitioning from C++ or Python who want to write code without memory leaks and data races.
  • Anyone who wants to understand how to implement complex algorithms in Rust from scratch.


What you will learn from the book:

  • Basic structures: linked lists, stacks, queues, hash tables taking into account Rust's specifics (for example, why a doubly linked list is a challenge for the borrow checker).
  • Sorting and searching algorithms: quicksort, heapsort, binary search, as well as implementation using iterators and closures.
  • Trees and graphs: binary search trees, AVL trees, red-black trees, graph traversals (DFS/BFS) with minimal memory allocation.
  • Dynamic programming: the knapsack problem, shortest path finding (Dijkstra, A*), optimization using Box, Rc, and RefCell.
  • Advanced topics: working with unsafe code for performance-critical structures, parallel algorithms using rayon and crossbeam.


Features of the edition:

  • Each chapter contains ready-made code examples with explanations.
  • Exercises and problems for independent solution (with answers at the end of the book).
  • Performance comparison of Rust implementations with counterparts in C and Python.
  • Recommendations for testing algorithms using cargo test and benchmarks.


This book will become your reliable companion in mastering algorithms in Rust. You will learn not only to write correct code but also to think in terms of safe memory management, which is especially important for systems programming, embedded systems, and high-load services.



Basic familiarity with Rust syntax is sufficient for reading. All necessary concepts (ownership, borrowing, lifetimes) are explained along the way.

Recommendations