▶Book Description
Rust has come a long way and is now utilized in several contexts. Its key strengths are its software infrastructure and resource-constrained applications, including desktop applications, servers, and performance-critical applications, not forgetting its importance in systems' programming. This book will be your guide as it takes you through implementing classic data structures and algorithms in Rust, helping you to get up and running as a confident Rust programmer.
The book begins with an introduction to Rust data structures and algorithms, while also covering essential language constructs. You will learn how to store data using linked lists, arrays, stacks, and queues. You will also learn how to implement sorting and searching algorithms. You will learn how to attain high performance by implementing algorithms to string data types and implement hash structures in algorithm design. The book will examine algorithm analysis, including Brute Force algorithms, Greedy algorithms, Divide and Conquer algorithms, Dynamic Programming, and Backtracking.
By the end of the book, you will have learned how to build components that are easy to understand, debug, and use in different applications.
▶What You Will Learn
⦁ Design and implement complex data structures in Rust
⦁ Analyze, implement, and improve searching and sorting algorithms in Rust
⦁ Create and use well-tested and reusable components with Rust
⦁ Understand the basics of multithreaded programming and advanced algorithm design
⦁ Become familiar with application profiling based on benchmarking and testing
⦁ Explore the borrowing complexity of implementing algorithms
▶Key Features
⦁ Use data structures such as arrays, stacks, trees, lists and graphs with real-world examples
⦁ Learn the functional and reactive implementations of the traditional data structures
⦁ Explore illustrations to present data structures and algorithms, as well as their analysis, in a clear, visual manner.
▶Who This Book Is For
Rust has great tutorials for learning the fundamentals of the language. There are workshops at every conference, regular meetups in many cities, and a very helpful online community. However, many developers find themselves beyond these resources but still don't feel ready for more complex solutions. Especially coming from different backgrounds with years of experience, the transition can be daunting: examples on the one side feature some type of a "Hello World!" program; on the other side, there are huge Rust open source projects with thousands of lines of code – impossible to learn from quickly. If you feel like this, then this book is for you.
▶What this book covers
⦁ Chapter 1, Hello Rust!, gives a short recap of the Rust programming language and what changed in the 2018 edition.
⦁ Chapter 2, Cargo and Crates, discusses Rust's cargo build tool. We will explore the configuration as well as the build process and modularization options.
⦁ Chapter 3, Storing Efficiently, looks at how in Rust, knowing where values are stored is not only important for performance, but also important for understanding error messages and the language in general. In this chapter, we think about stack and heap memory.
⦁ Chapter 4, Lists, Lists, and More Lists, covers the first data structures: lists. Using several examples, this chapter goes into variations of sequential data structures and their implementations.
⦁ Chapter 5, Robust Trees, continues our journey through popular data structures: trees are next on the list. In several detailed examples, we explore the inner workings of these efficient designs and how they improve application performance considerably.
⦁ Chapter 6, Exploring Maps and Sets, explores the most popular key-value stores: maps. In this chapter, techniques surrounding hash maps; hashing; and their close relative, the set; are described in detail.
⦁ Chapter 7, Collections in Rust, attempts to connect to the Rust programmer's daily life, going into the details of the Rust std::collections library, which contains the various data structures provided by the Rust standard library.
⦁ Chapter 8, Algorithm Evaluation, teaches you how to evaluate and compare algorithms.
⦁ Chapter 9, Ordering Things, will look at sorting values, an important task in programming—this chapter uncovers how that can be done quickly and safely.
⦁ Chapter 10, Finding Stuff, moves onto searching, which is especially important if there is no fundamental data structure to support it. In these cases, we use algorithms to be able to quickly find what we are looking for.
⦁ Chapter 11, Random and Combinatorial, is where we will see that, outside of sorting and searching, there are many problems that can be tackled algorithmically. This chapter is all about those: random number generation, backtracking, and improving computational complexities.
⦁ Chapter 12, Algorithms of the Standard Library, explores how the Rust standard library does things when it comes to everyday algorithmic tasks such as sorting and searching.