Why a second edition? In the few years since the original edition was published, I’ve had the opportunity to teach these topics to various audiences. Over time, I continued to refine my explanations as well as discover additional topics that I thought were exciting and important. There was also quite a bit of demand for hands-on exercises that would help people gain practice with these concepts.
Accordingly, the second edition has the following new features:
-
Revised material . I’ve made significant revisions to the original chapters for the sake of clarity. While I thought that the first edition did a pretty good job in making these complex topics easy to understand, I found that there was room to make certain areas even clearer.
Many sections of the original chapters have been entirely rewritten, and I’ve added brand-new sections as well. I feel that these revisions alone have enhanced the book to make it worthy of a new edition.
-
New chapters and topics . The second edition contains six new chapters that cover topics I’m particularly excited about.
The book has always blended practice with theory, but I added even more material that you can take straight to the bank. The chapters Chapter 7, Big O in Everyday Code and Chapter 20, Techniques for Code Optimization focus exclusively on day-to-day code, and how knowledge of data structures and algorithms can help you write more efficient software.
I went all out when it came to recursion. While the previous edition contained a chapter on this topic, I devoted an entirely new chapter, Chapter 11, Learning to Write in Recursive , to teach you how to write recursive code, which can be confusing for beginners. I haven’t seen this explained anywhere else, and I think it’s a unique and valuable addition. I also added the chapter, Chapter 12, Dynamic Programming , which is a popular subject, and one critical to making recursive code more efficient.
There are many data structures out there, and it’s difficult to select which to include and which to leave out. However, there’s been increased demand to learn about heaps and tries, and I’ve found them to be fascinating as well. Hence the chapters, Chapter 16, Keeping Your Priorities Straight with Heaps and Chapter 17, It Doesn’t Hurt to Trie .
-
Exercises and solutions . Each chapter now has a number of exercises that allow you to gain hands-on practice with each topic within the book. I also added detailed solutions, which are available in an appendix at the back of the book. This is a significant enhancement that transforms the book into a more complete learning experience.