Appendix

For simplicity and flexibility, we have used input and output sparingly in the programs in this book. Most of our programs are ADT implementations intended for use with diverse clients, but we also exhibit the driver programs that you need to run and test the programs on your own data. Programs 1.1, 6.1, and 12.6 are typical examples. In these drivers:

• We use the command line to get values of parameters.

• We take input data from the standard input stream.

• We print out results on the standard output stream.

The conventions for taking parameter values are standard in Java (and the mechanism is described in Section 3.7); in this Appendix, we present the classes that we use for input and output.

Rather than directly using Java library ...

Get Algorithms in Java, Third Edition, Parts 1-4: Fundamentals, Data Structures, Sorting, Searching now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.