Corrections for the Second Edition

Data Structures and Other Objects Using C++
Second Edition
by Michael Main and Walter Savitch
ISBN 0-201-70297-5, Softcover, 816 pages

Here is a list of corrections for the first printing of second edition of the text (with the words "Second Edition" in a blue circle on the front cover).

If you find further errors, please drop me a line by email. I enjoy corresponding with readers!
--Michael Main (

Page 210: This figure is file node1.h (not node1.cxx).

Page 266: Figure 5.17 has several spots where "node" should be "dnode",
and a missing semi-colon after the last statement of the constructor.

Page 269: Project 14: Omitting the precursor causes other problems too
(such as deleting the tail node).
Page 359: Some compilers do not implement the Koenig lookup. Therefore,
in stack2 (pages 360-262) and queue2 (pages 406-409), it might be better
to go ahead and use the scope resolution operator main_savitch_6B::
with each list function (such as main_savitch_6B::list_clear).

Page 370: The second else-if in Figure 7.12 should be written as a loop:
while (none of the three conditions are true)
    print the top operation and pop it.

Page 373: Answer 13 should refer to Figure 7.10 on page 365.
Answer 14 should refer to Figure 7.13 on page 371.

Pages 403 and 409: The name of the queue class is queue (not Queue).
Also, on page 403 the pop function is void (it does not return an item).

Page 434: The end of the function call should have only two recursive calls.
(The first of these calls was accidentally repeated twice.)

Page 464-465: Please see

Page 494 and 496: The node_ptr parameter of the print function should be const.

Page 503: The highlighted line should be:
    root_ptr = new binary_tree_node(entry)

Page 585: In general, the return value from hash2 could be as large as
data.length-1, but Knuth's particular hash2 will never exceed data.length-2.

Page 651: The figure referred to in the last paragraph should be 14,3.