Java Reference
In-Depth Information
IX: {Series|(} {2}
IX: {Series!geometric|(} {4}
IX: {Euler's constant} {4}
IX: {Series!geometric|)} {4}
IX: {Series!arithmetic|(} {4}
IX: {Series!arithmetic|)} {5}
IX: {Series!harmonic|(} {5}
IX: {Euler's constant} {5}
IX: {Series!harmonic|)} {5}
IX: {Series|)} {5}
figure 12.31
Sample input for
Exercise 12.19
Add the robust error checks for the compression program suggested
at the end of Section 12.1.3.
12.16
Analyze empirically the performance of the compression program
and determine whether its speed can be significantly improved. If so,
make the required changes.
12.17
Split the Tokenizer class into three classes: an abstract base class
that handles the common functionality and two separate derived
classes (one that handles the tokenization for the balanced symbol
program, and another that handles the tokenization for the cross-
reference generator).
12.18
Generate an index for a book. The input file consists of a set of index
entries. Each line consists of the string IX: , followed by an index
entry name enclosed in braces and then by a page number enclosed in
braces. Each ! in an index entry name represents a sublevel. A |( rep-
resents the start of a range and a |) represents the end of the range.
Occasionally, this range will be the same page. In that case, output
only a single page number. Otherwise, do not collapse or expand
ranges on your own. As an example, Figure 12.31 shows sample input
and Figure 12.32 shows the corresponding output.
12.19
Use a map to implement a spelling checker. Assume that the dictio-
nary comes from two sources: one file containing an existing large
dictionary and a second file containing a personal dictionary. Output
12.20
Euler's constant: 4, 5
Series: 2-5
arithmetic: 4-5
geometric: 4
harmonic: 5
figure 12.32
Sample output for
Exercise 12.19
Search WWH ::




Custom Search