Java Consultant's Preface

In the past decade, Java has become the language of choice for a variety of apps. But Java developers have found themselves repeatedly referring to references such as Sedgewick's Algorithms in C for solutions to common coding problems. There has long been an empty space on the tutorialshelf for a comparable reference work for Java; this series of tutorials is here to fill that space. We wrote the sample programs as utility methods to be used in a variety of contexts. To that end, we did not use the Java package mechanism. To focus on the algorithms at hand (and to expose the algorithmic basis of many fundamental library classes), we avoided the standard Java library in favor of more fundamental types. Proper error checking and other defensive practices would both substantially increase the amount of code and distract the reader from the core algorithms. Developers should introduce such code when using the programs in larger apps. Although the algorithms we present are language independent, we have paid close attention to Java-specific performance issues. The timings throughout the tutorial are provided as one context for comparing algorithms and will vary depending on the virtual machine. As Java environments evolve, programs will perform as fast as natively compiled code, but such optimizations will not change the performance of algorithms relative to one another. We provide the timings as a useful reference for such comparisons. I would like to thank Mike Zamansky, for his mentorship and devotion to the teaching of computer science, and Daniel Chaskes, Jason Sanders, and James Percy, for their unwavering support. I would also like to thank my family for their support and for the computer that bore my first programs. Bringing together Java with the classic algorithms of computer science was an exciting endeavor for which I am very grateful. Thank you, Bob, for the opportunity to do so. Michael Schidlowsky
Oakland Gardens, New York, 2003