About the Code
All implementations in this book are in C. C was chosen because it is still the most general-purpose language in use today. It is also one of the best languages in which to explore the details of data structures and algorithms while still working at a fairly high level. It may be helpful to note a few things about the code in this book.
- All code focuses on pedagogy first
There is also a focus on efficiency, but the primary purpose of all code is to teach the topic it addresses in a clear manner.
- All code has been fully tested on four platforms
The platforms used for testing were HP-UX 10.20, SunOs 5.6, Red Hat Linux 5.1, and DOS/Windows NT/95/98. See the readme file on the accompanying website http://examples.oreilly.com/masteralgoc/) for additional information.
- Headers document all public interfaces
Every implementation includes a header that documents the public interface. Most headers are shown in this book. However, headers that contain only prototypes are not. (For instance, Example 12.1 includes sort.h, but this header is not shown because it contains only prototypes to various sorting functions.)
- Static functions are used for private functions
Static functions have file scope, so this fact is used to keep private functions private. Functions specific to a data structure or algorithm’s implementation are thus kept out of its public interface.
- Naming conventions are applied throughout the code
Defined constants appear entirely in uppercase. Datatypes and global variables ...