Lab Manual to accompany
C++:  An Introduction to Data Structures

by Larry Nyhoff, 
Calvin College Department of Computer Science

Upper Saddle River, New Jersey: Prentice-Hall, 1999
(ISBN 013-084691-0)

Table of Contents
Lab and Project Files
Some Supplementary Items

A lab manual to accompany my text C++:  An Introduction to Data Structures has been published. It  contains a collection of lab exercises and projects that have been used successfully in my CS2 course for the past several years.  They are are of a tutorial / "try-this" / "what-happens-if" nature. Each is accompanyied by a project that uses / builds on / extends what was covered in the lab exercise. Source code used in these lab exercises and projects is also available.  Thse labs and projects are coordinated with the material in the text.  Typically, each lab involves a file that students work with as they work through the lab exercise, modifying it, then compiling and executing it, and reporting what happens.  Listings of these files are included in Appendix: Files, but they can also be downloaded from

Several of the labs and projects are really double lab-project pairs; for example, Lab and Project 2 consist of Lab Exercise 2A and Project 2A plus Lab Exercise 2B and Project 2B.  Either pair may be selected as the weekly lab/project for that chapter, or both may be used.

Some of the labs and projects may have more material than is appropriate for your course.  Almost all of them are designed, however, in such a way that parts of them may be omitted or replaced.

The lab exercises and projects have all been used in a course using UNIX-based gnu C++.  They have also been tested using Metrowerks' CodeWarrior C++ and are being tested in Microsoft's Visual C++.  They should all execute in any environment that supports ANSI standard C++.

Table of Contents

Lab and Project 1
Lab Exercise 1A: Testing a Program
Lab Exercise 1B: Addresses
Project 1: Displaying Integers in Binary
Lab and Project 2
Lab Exercise 2A: Creating Types: Enumerations
Project 2A: Extending a Data Type: Enumerations
Lab Exercise 2B: Arrays and Addresses
Project 2B: Multidimensional Arrays
Lab and Project 3
Lab Exercise 3: Enumeration Classes
Project 3: Enumeration Classes Ñ A Continuation of Lab 3
Lab and Project 4
Lab Exercise 4: Queues Ñ A Tutorial
Project 4: Queue Exercises; Palindrome Program
Lab and Project 5
Lab Exercise 5: vectors Ñ A Tutorial
Project 5: vectors of System Tasks
Lab and Project 6
Lab Exercise 6A: Recursion
Project 6A: Tracing Recursion
Lab Exercise 6B: Algorithm Efficiency
Project 6B: Comparing Algorithms
Lab and Project 7
Lab Exercise 7: Pointers & Dymamic Allo- / Deallo-cation
Project 7: More About Queues
Lab and Project 8
Lab Exercise 8: Linked Lists
Project 8: More About Linked Lists
Lab and Project 9
Lab Exercise 9: Binary Search Trees
Project 9: More About BSTs; Concordance
Lab and Project 10
Lab Exercise 10: Sorting
Project 10: More Sorts: Bar Graphs
Lab and Project 11
Lab Exercise 11: Inheritance
Project 11: Inheritance: Data Sets
Appendix: Files

Lab and Project Files

Source code for all of the example programs and classes used in the labs and projects.

Some Supplementary Items

As described in the lab manual:

  This page maintained by Larry Nyhoff Last modified: