As you may have guessed, this book talks quite a bit about data structures and algorithms. More specifically, the book is laid out as follows:
In Chapter 1, Why Data Structures Matter and Chapter 2, Why Algorithms Matter , I explain what data structures and algorithms are and explore the concept of time complexity—which is used to determine how fast an algorithm is. In the process, I also talk a great deal about arrays, sets, and binary search.
In Chapter 3, O Yes! Big O Notation , I unveil Big O Notation and explain it in terms that are easy to understand. We use this notation throughout the book, so this chapter is pretty important.
In Chapter 4, Speeding Up Your Code with Big O , Chapter 5, Optimizing Code with and Without Big O , and Chapter 6, Optimizing for Optimistic Scenarios , we delve further into Big O Notation and use it to make our day-to-day code faster. Along the way, I cover various sorting algorithms, including Bubble Sort, Selection Sort, and Insertion Sort.
In Chapter 7, Big O in Everyday Code , you apply all that you learned about Big O Notation and analyze the efficiency of code from the real world.
In Chapter 8, Blazing Fast Lookup with Hash Tables and Chapter 9, Crafting Elegant Code with Stacks and Queues , I discuss a few additional data structures, including hash tables, stacks, and queues. I show how they impact the speed and elegance of our code and how we can use them to solve real-world problems.
Chapter 10, Recursively Recurse with Recursion introduces recursion, an anchor concept in the world of computer science. We break it down in this chapter and see how it can be a great tool for certain situations. Chapter 11, Learning to Write in Recursive teaches you how to write recursive code, which can otherwise be quite confusing.
Chapter 12, Dynamic Programming shows you how to optimize recursive code and prevent it from spiraling out of control. And Chapter 13, Recursive Algorithms for Speed shows you how to use recursion as the foundation for turbo-fast algorithms like Quicksort and Quickselect, and takes your algorithm-development skills up a few notches.
The following chapters, Chapter 14, Node-Based Data Structures , Chapter 15, Speeding Up All the Things with Binary Search Trees , Chapter 16, Keeping Your Priorities Straight with Heaps , Chapter 17, It Doesn’t Hurt to Trie , and Chapter 18, Connecting Everything with Graphs , explore node-based data structures including the linked list, the binary tree, the heap, the trie, and the graph, and show how each is ideal for various applications.
Chapter 19, Dealing with Space Constraints explores space complexity, which is important when programming for devices with relatively small amounts of disk space, or when dealing with big data.
The final chapter, Chapter 20, Techniques for Code Optimization , walks you through various practical techniques for optimizing the efficiency of code, and gives you new ideas for improving the code you write every day.