xiv PREFACE
is tantamount to telling students that they ought to eat their vegetables because
years later they will appreciate having done so.
In response to this first problem, I have tried to limit the discussion of metaphys-
ical, moral, and theological aspects of Java (or any language) to those concepts that
can be firmly grounded in practice in the second semester of a computer science
curriculum. Yes, the compiler writers have done some very cool things. No, I don’t
see that this is necessary in a second-semester course.
The second premise of the book is that necessity is the mother of invention
and that sophisticated algorithms and data structures have their natural place
in the world. If one is never going to do anything more complicated than a pro-
gram to balance one’s personal checking account, it’s not clear that anything more
sophisticated than bubblesort or linear search will ever be needed. It is when the
naive methods fail us that we implement more clever approaches, and I have tried
to emphasize this point. I have always been of the opinion that a program that
executes without crashing, even if it doesn’t do exactly what is desired, is much
more valuable than a program that has all the sophisticated logic programmed
in ... except for a few bugs that crash the program every time. This opinion is
what is usually used in the “bottleneckology” of high-performance computing—
focus on the most time-consuming part of the code and make that part disappear.
Since something else will now become the most time consuming, this is an iter-
ative process until the law of diminishing returns sets in. Similarly, a program
that does what is needed, albeit perhaps only on data sets of test size, can be
improved piecemeal, method by method, class by class, until it can handle the
real job.
For the convenience of the instructor, I have tried to map the contents of
this book against the learning objectives of the curricular guidelines from ACM
and IEEE in Computer Science Curriculum 2008.Wehaveassumedthatthis
is a second-semester text, and thus that the PF/FundamentalConstructs and
PF/DataStructures (objectives 1, 3, 4, 5, and 7) areas have already been cov-
ered. We also assume some familiarity with DS/FunctionsRelationsAndSets. For
the material in Chapter 6 and the discussion of algorithm analysis in general we
assume a familiarity with differential calculus. Although we do need differentiation
of logarithms and exponentials on a few occasions, we do not need any trigonom-
etry. The crucial part of calculus that is used repeatedly at least in Chapter 6 is
L’Hˆopital’s rule. The numbers in parentheses after the topic area in the following
table are our estimates of the coverage of this book compared to the number of
hours estimated in Computer Science Curriculum 2008 to be necessary for minimal
coverage of the topic.