O'Reilly logo

Data Structures Using Java by Duncan A. Buell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

1.2 Examples 9
1.2 Examples
1.2.1 Card Catalogs
Although it is not necessarily one of the more exciting applications of data struc-
tures, the card catalog of a library is one example of a large data file that needs to
be properly organized to be useful to the user community. These used to be physical
cards, as shown in Figure 1.1, but are now almost always kept entirely online in
large libraries.
FIGURE 1.1 A card from a library card catalog.
The first thing to note is that the card catalog data is stored essentially only once
(unless there are corrections to be made, and these should be rare). Except for a data
field indicating whether the document is or is not checked out of the library (and
the possible checkout history that we will ignore), the data file, although perhaps
large (libraries in major universities have collections numbering in the millions of
volumes), is very static. The issue with this kind of data is not constant updating
but rather that the data can be accessed by multiple search keys. In this case,
access by author name, document title, Library of Congress classification number,
keywords, perhaps accession date, and perhaps also due date for documents checked
out, would be necessary. We will want to use a data structure that permits records
to be added over time, and there will be records that occasionally get deleted, but
the major issue is not the change in the data file but in the efficient retrieval of
record information.
Data such as card catalog data is usually very highly structured. Indeed, sub-
stantial effort has been expended by the U.S. Library of Congress to standardize
card catalog data so that records are uniform in all libraries in the country.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required