In these pages, you will find detailed explanations, some implementations, example uses, and exercises,all designed to build your understanding to a point where you can use this knowledge in the real world.The examples given are rarely, if ever, academic in nature. Very careful consideration has been given in each chapter to present you with code that, in most cases, could be used in real-world applications,immediately.
We tried very hard to adhere to many of the most commonly accepted software development practices.These include the use of Design Patterns [Cormen, 2001], coding conventions, quality checks, and fullyautomated unit tests. We hope that in addition to an understanding of algorithms and their importancein problem-solving, you will come away with a deeper appreciation for how to build robust, extensible,and, of course, functional software.
For those of you who are more familiar with the Java language, you may notice a certain overlap betweenthe classes described in this book and those found in the java.util package. This book is not concernedwith the specific implementations found in the Java libraries. Rather, we hope to give you an insight intowhy the designers of the Java language felt that it was so important to include specific implementations ofcertain algorithms and data structures, including how they work and when to use them.
As already noted, this book is not designed to teach you the basics of computer programming in generalor Java programming in particular. It does not explain how to use the standard Java libraries, for that isnot the intent. While the code examples may use any classes from the java.lang, and in some cases thejava.io, packages, all other Java packages were off limits. Instead, throughout the course of this book,you will build all the necessary classes by hand, which will enable you to experience the satisfaction thatcomes with discovering algorithms for yourself.
Although significant emphasis is placed on unit testing in each chapter, this book is not a study of, oreven a guide to, unit testing. Rather, it is hoped that by exposing you directly to unit test code, you will gain an understanding of basic unit testing techniques.