These are the code fragments from the textbook Data Structures and Algorithm Analysis in C++ Mark Allen Weiss Benjamin/Cummings, 1994 ISBN: 0-8053-35443-3 My intent is to allow instructors to easily make overhead transparencies, and to allow students to save the time of directly typing in source code. Thus, these are not complete programs. Students must still figure out how all of the pieces fit together. Some of the classes in the text exhibited the following problems, which I believe are all relatively minor: 1. The copy constructors are incorrect. The intention is to discourage their use, which I believe is the right thing to do. The problem is that the implementation by using operator= is incorrect. A better solution is to place the prototype for the copy constructor in the private section. 2. Some routines such as linked lists and trees declare a struct node internally. CC does not yet implement this. You'll have to move it out of the class. g++ and Borland's compilers have no problems. 3. In many places, the constructor for the node struct assumes a default Etype is 0. This doesn't work for every Etype. The solution is to add a zero-parameter constructor and remove the default for Etype. 4. Alot of the classes overload ( ) to return an Etype. It's better to return a const reference. Things get tricky here, however. For example, PopAndTop for a stack implementation can return a const reference, but for a linked list implementation, a const reference would refer to an item in a deleted node! The code here reflects these changes. --Mark Weiss For more information about Benjamin/Cummings books, send e-mail to: bookinfo@bc.aw.com If you have any problems retrieving these files, or need any assistance, send e-mail to: ari@bc.aw.com Last updated: July 1994