For CS2/Data Structures courses using C++. This book uses a modern object-oriented approach to data structures, unified around the notion of the Standard Template Library (STL) container classes. The book presents a systematic development of data structures supported by numerous examples and complete programs. The authors separate the applications of a data structure from its implementation. In the later chapters, the book transitions students into the study of applied algorithms. This creates a bridge to subsequent courses in advanced data structures and algorithms.
Because of physical problems with this book, the authors' programming style, and lack of a proper audience, I just can't recommend it. There are just too many problems and too few positives for the book to be worthwhile.
First, the physical problems with the book: in my case, the binding appears to be bad. As I took it out of its plastic wrapping, I noticed a gap between the cover spine and the glued/sewn binding of the actual pages. It looks like the glue that was supposed to hold the two parts of the book together failed. Turning the pages causes a lot of snapping, crackling, and popping and I worry that the binding will break. Second, it seems like the book uses too small a font (these old eyes don't focus like they used to). Oddly, if I compare the font size to that in other textbooks, it looks comparable. I'm not sure, but I think the publisher used a slightly smaller line spacing and either a lighter ink or darker paper. Whatever it is, it makes reading the book a bit hard. That's pretty subjective and minor, but more aggravating is that the publisher used an even lighter (gray) font for the code segments. This makes the code even harder to read than the text. Again, I'm not certain, but it also looks like the font in the code sections is even smaller than the font in the text. And finally, the authors don't use any color in their code. It's hard to distinguish the actual code from the comments. This makes reading the code difficult.
Next, I highly disagree with the authors' coding style. Essentially, I consider it sloppy. In general, they don't write their class methods to ensure data integrity (and that's one of the big advantages of classes (which are at the core of this book)). Also, the authors tend to directly access private class members within the class methods instead of using the class' already defined public methods that do the same thing (get/set). I know this is allowed, but it's still bad software engineering: you should re-use code wherever possible. Similarly, and worse, the authors violate the principles of data hiding by writing classes with public data members instead of with private data members and public get/set methods. I also have a problem with the authors using "using namespace std;" in their code. Since this exposes all of the C++ standard library methods to the program, it can lead to conflicts. I understand that in a teaching environment this might be good for keeping the focus on the topic at hand instead of "cluttering up the code" with nuances, but the authors make no reference to this rationale. They just blindly use that line in all their code. I'd much prefer they explicitly did a "using std::whatever;" when they needed it. What's especially bad is that they do this in all the HEADERS they provide for their examples (not just in the "main" programs). Anyone who uses any of those headers automatically ends up with all the namespace names included in their code. And, finally, not only are the authors lax in their object oriented programming, they're also lax in their structured programming: they routinely, and without comment, use break statements to jump out of the infinite for-loops (which are feats in themselves) they set up to handle their file input.
Finally, and most importantly, the authors don't seem to have a grasp on who their audience is. In the Preface and the start of the first chapter, they specifically state that the readers should already be familiar with objects and classes from a first course in C++. They note that they aren't about to review old topics, but, instead, will pick up where that left off. However, most of the book is a re-hashing of basic C++ programming. For instance:
- Chapter 1 is a review of programming classes (and, thus, objects) in C++.
- Chapter 3 covers templates and recursion. The algorithms discussed are those usually presented in C++ programming courses: selection sort, sequential search, binary search, tower of hanoi, and greatest common divisor.
- Chapter 5 goes over pointers, pointer arithmetic, dynamic memory allocation, constructors and destructors.
All of this is what I consider to be basic C++ (see Deitel's "C++ How to Program" book to find references to all those things). I just can't see how anyone could learn even the rudiments of C++ without having covered those topics. I could be wrong (in which case, since I've provided my rationale for my rating, you'll at least know what to ignore in this review). But, for all intents and purposes, the authors don't really start teaching anything new until after page 500 (Chapter 10) in a 1000 page (16 chapter) book. And even there, I was so irritated with the various problems I noted above, that I kept wondering how much credence to put in the authors' presentation.
So, in a nutshell, because of the physical problems with the book itself, the sloppiness of the authors' programming style, and their mis-identification of the audience, I can't recommend this book. I rate it at only 2 stars out of 5.
As a side note, at the time I bought this book, Florida State University (FSU) used it in their COP 4530: "Data Structures, Algorithms & Generic Programming" course. They've now switched to a book called "Data Structures & Algorithms in C++," 3e, by Drozdek. I don't know anything about that book, but based solely on this book, FSU did the right thing.