Java Structures' FAQ Page

Here are answers to some common questions about the structures package.
What is the structure package all about?

I wrote the structure package because core Java has poor support for the study of object-oriented data structures. This state is improving but, still, there are many inconsistencies and holes within the Java language packages available from Sun that make teaching a course on data structures (CS2) difficult. These issues are, somewhat, covered in the text.

Here, however, are some highlights:

Who may use the structures package?

The structures package is freely available for non-commercial use from McGraw-Hill. You need not buy the text to use it, but you may not make money from its use.

Under what environments may this code be used?

The structures package available currently from McGraw-Hill works with any environment that is Java JDK 1.1 compliant. Software that works specifically with JDK 1.2 is also available. As Sun improves its support for data structures, the structures package is made to be as consistent as possible with the existing JDK.

You provide javadoc-based documentation, but there is no javadoc documentation in the source code. Why?

The on-line documentation is generated from a master copy of the structure package that has these comments. For release, these comments are removed, providing a more readable source for programmers to peruse. Javadoc comments are great reading for the javadoc utility; they're not so great for humans.

The javadoc comments are a subset of the comments found in the source.

If you believe you absolutely need the javadoc comments, contact the author at
You re-implement some data structures already implemented by Sun. Why?

To ensure there are no copyright infringements I provide (often simpler) non-commercial implementations of some classes. Sometime of these implementations may not be as efficient as the commercial classes, but the details of the implementation are easier to grasp. Of course, if necessary, the code can be modified to make use of those implementations found in Java's native classes.

What do you mean by "for the principled programmer"?

Learning how to program well is a difficult task. One that can, arguably, take many years of practice beyond coursework. One of the reasons for this is that there are a number of "tricks of the trade" or "heuristics" that guide experienced programmers, that are not often conveyed (or conveyed well) by existing texts. In the Java Structures text, I present a number of "principles" (rules-of-thumb, really) that guide the data structure design process.

Why are private fields of the structures not declared private?

The reasoning for this is long and drawn out (and discussed more fully in the text), but basically, there is no disadvantage to declaring these fields protected. The particular distinctions between private, protected, public, and default protects are rather technical and their motivation is somewhat difficult to understand.

What differences are there between the JDK 1.1 and the JDK 1.2 versions of the software?

When JDK 1.2 was announced, Sun added a number of important new features to their packages - including - - java.lang.Comparable. Java Structures defines a very similar interface, called structure.Comparable. Because of a naming conflict introduced by the default importing of java.lang, I made the decision to adopt Sun's definition of Comparable. This necessitates recasting many of the classes of the structure package, requiring a re-release. I do not expect conflicts in the future, but Sun may further encroach on the namespace of data structures distributed under the structure package.

Do you teach this course using applets or applications?

When I teach this course, I teach it using applications. Many of my colleagues use applets. Either approach is satisfactory, as long as Java, itself, does not get in the way of understanding data structures.

Unfortunately, there are many disadvantages to using applets in this course - the primary problem being security. Security makes it difficult (and sometimes impossible) to perform input from a keyboard, or to read data from a file. Both of these are often useful in a data structures course.

Here is something to think about. As tax-paying citizens, we keep track of tax freedom day - the first day of the year that we are earn money above and beyond the money we earn to pay our taxes. (Currently, that day appears about 28% of the way through the calendar year...ironically, in mid-April.) In a typical programming course, what is Programmer Freedom Day - the day that a programmer can first be expected to write an entire program without the help of the instructor.

Unfortunately, Programmer Freedom Day has been moving later and later in the semester. To use applets, Programmer Freedom Day is considerably later than if you use applications.