Sample Programming Assignments

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


I'm still working on adding new exercises to this page. If you have assignments that worked well for your class, please let me know and I'll add them to this list.

--Michael Main (main@colorado.edu)


Lab Exercises

If your students are using Unix, feel free to copy and modify these exercises for your own class.

Programming Assignments

You can copy and modify these programming assignments, or use them as is for your own class. WARNING TO STUDENTS: These are only sample assignments; check with your instructor to find out what your actual programming assignments are.
Chapter 2:
A Simple Statistician Class
Chapter 3:
First Edition of Text: The List Class from Section 3.2 (with a fixed array)
Later Editions of Text: The Sequence Class from Section 3.2 (with a fixed array)
A Preliminary Polynomial Class (with a fixed-size array)
Clean-up Notes for the Preliminary Polynomial
Chapter 4:
First Edition of Text: The List Class with a dynamic array.
Later Editions of Text: The Sequence Class with a dynamic array.
The Polynomial Class with a Dynamic Array.
The Bag with Receipts, using dynamic arrays.
Chapter 5:
Extending the Linked List Toolkit.
Extending the Linked List Toolkit (Version 2).
First Edition of the Text: The List Class with a linked list.
Later Editions of Text: The Sequence Class with a dynamic array.
The polynomial class with a linked list.
Using the polynomial in a CGI program.
Chapter 6:
For the First Edition of Text: The List Template Class with an External Iterator.
Later Editions of Text: The Sequence Class with a dynamic array.
Chapter 7:
Evaluator for Postfix or Infix Expressions.
Chapter 8:
A Priority Queue Class.
A Simple Traffic Light Simulation.
Chapter 9:
Four Small Recursive Functions.
Four More Small Recursive Functions.
(Preliminary Version) A Recursive Permutation Generator.
Chapter 10:
A Binary Search Tree Implementation of the Bag (now using the new binary_tree_node from the second edition)
Chapter 11:
A Heap Implementation of the Priority Queue Class.
A B-Tree Implementation of the Set Class.
Chapter 12:
A Chained Hash Table.
Chapter 13:
A Quicksort Function.
The Standard Library Quicksort Function.
Chapter 14:
Ideas for Derived Game Classes from Section 14.3.
Preliminary Version of a Short Bonus Assignment on Inheritance.


Data Structures and Other Objects Using C++

Michael Main (main@colorado.edu)
and
Walter Savitch (wsavitch@ucsd.edu)

Thank you for visiting http://www.cs.colorado.edu/~main/projects/