CS 70, Spring 2001
Data Structures and Program Development

Quick index:

  • Useful general information
  • Finding tutors and professors
  • Course content
  • Reading assignments
  • Homework assignments and FAQs
  • Course handouts
  • Class summaries
  • Exam results
  • Administrative matters, including honor-code questions
  • Class suggestion box
  • Useful Information

    The tutors and graders assigned to this course are:

    Please do not leave voice-mail messages regarding CS70 questions. If you cannot reach someone, send mail to cs70help instead.

    You can always get help from the graders and the professor by sending mail to cs70help@cs.hmc.edu. This is a good way to report problems or to get quick help on a homework question. DO NOT send mail to cs70grad to get help. Mail to this account will never be answered promptly, and usually will not be answered at all.

    Finding Geoff

    My weekly schedule is posted on the Web for all to see. I am generally in my office every day except Friday. If the door is open, please feel free to drop in with your questions. Even if I happen to be busy, I'll at least know that you need to talk to me and we can set up an appointment to talk. If you are on a computer, the command finger @mallet will generally tell you whether I'm logged in and have multiple active windows, which is a very good sign that I'm in the office.

    As a general rule, the talk utility is not a good way to reach me, regardless of what machine you are trying to reach me at. I usually keep my command windows closed and my bell disabled, so I will never see the talk request.

    I will normally try to be in my office in the evening on Wednesdays when an assignment is due. You can e-mail me, call me (x71610), or stop by with your questions.

    On Fridays I do research. You can sometimes reach me by calling 310-825-7307, though you'll rarely get an answer between 1 and 3 PM, when I'm in meetings. In general, if I'm available to answer the phone, I'm also available to answer questions. If you can't get me by phone, send e-mail.

    Catalog Description

    Abstract data types including priority queues, dynamic dictionaries, and disjoint sets. Efficient data structures for these data types, including heaps, self-balancing trees, and hash tables. Analysis of data structures including worst-case, average-case, and amortized analysis. Storage reclamation and secondary storage considerations. Extensive practice in implementing these data structures in several languages for a variety of applications.

    What's really covered: as with most courses, the catalog description isn't 100% accurate. A better description of what we cover is:

    Major features of the C++ language, including pointers, classes, templates, and operator overloading. Extensive practice in professional-quality programming. Abstract data types and data structures, including arrays, lists, stacks, queues, dequeue, dynamic dictionaries. Efficient data structures for these data types, including arrays, lists, trees, self-balancing trees, hash tables, and B-trees. Memory management. Practical aspects of using data structures in programs. Analysis of data structures, including worst-case, average-case, and amortized analysis.

    Prerequisites: Computer Science 60.
    3 credit hours.


    In this course, you should learn

    You will also get lots of practice writing software, including some moderately large programs, so as to improve your coding skills and speed.

    Topic Outline

    List of key topics, (very) approximately in the order in which they will be covered:

    Homework Assignments

    There will be about 11 homework assignments. Most will take 1 week, but you will be given 2 weeks to complete a few of them, due either to difficulty or to other factors such as school breaks. Assignments will be posted here and announced on the class mailing list. Assignments will generally be due on Wednesday evenings at 9 P.M. See the homework policies and homework grading guidelines pages for general information on homework. There is also a page of frequently asked questions about homework that is worth checking from time to time.

    Homework assignment #1, cleaning up stylistically bad code, and its grading curve.

    Homework assignment #2, a program to find stylistically bad constructs, and its grading curve.

    Homework assignment #3 (which also includes assignment #4), a registrar database for Deep Glen Polytechnic. and the grading curves for homework 3 and homework 4.

    Homework assignment #5, interactive debuggers, and its grading curve.

    Homework assignment #6, complexity analysis, and its grading curve.

    Homework assignment #7, a genetic algorithm, and its grading curve.

    Homework assignment #8, a bar simulation, and its grading curve.

    Homework assignment #9, an encryption program using chunky stringsl, and its grading curve.

    Homework assignment #10, a hash-based spell checker, and its grading curve.

    Homework assignment #11, binary trees and binary I/O, and its grading curve.


    The following handouts were provided to students in class. For those who missed the lecture, or who wish to make use of code from the handouts, they are also available for downloading here. Note that C++ source files are exactly the same as were presented in class, which means that any bugs discovered during the lecture are still present.

    Postscript files may be printed from Turing by simply typing "lpr foo.ps". They may be directly viewed with the utility gv (if your shell claims it's not found, try /usr/openwin/bin/gv).

  • From January 17, 2001: quick facts for the first day of class (Postscript).
  • From January 22, 2001: examples of good and bad style (Postscript).
  • From February 5, 2001: the recipe for Prof. Kuenning's killer chocolate-chip cookies.
  • From February 14, 2000: The broken matrix multiplication program (with commentary added), a really broken version of the same program, and a version with all the bugs fixed.
  • From February 26, 2001: a simple Makefile.
  • From March 26, 2001:
  • The header file for the dumb-container class and iterator.
  • The implementation for the dumb-container class and iterator.
  • A simple Makefile for the dumb-container example.
  • A simple test program for the dumb-container class.

  • Class Summaries

    At the beginning of each class session, two students will be asked to present a 5-minute summary of what occurred in the previous class session. These summaries should be cooperative (i.e., you shouldn't both cover the same material). The summaries will become part of your class participation grade. There is more information on the Class Summaries Web Page.

    The summaries are scheduled well in advance for both Section 1 (1:15 PM) and Section 2 (2:45 PM). Please check these schedules and be prepared for your summaries.

    Exam Results

    The midterm has been graded and the curve is available.

    The final has been graded and the curve is available.

    Helpful C++ Information and Code Examples

    The course has inherited a number of pages that contain notes on all sorts of useful topics from Prof. Margaret Fleck, who has since left HMC.

    Reading Assignments

    Reading assignments are selected from all three texts.

    Week Due Date Assignment Total Pages Subject Lecture Topic(s)
    1 January 17 No reading assignment Class introduction
    Overview of style
    2 January 22 Kernighan & Pike, Chapter 1.
    Stroustrup, 1.1, 1.2, 1.7, 1.8; Chapter 2; 6.4.
    A tour of C++; Style
    Programming style
    January 24 Stroustrup, Chapter 4. 18 Types and declarations
    3 January 29 No reading assignment
    January 31 Weiss 1-1.3, D.1, D.3.
    Stroustrup 5.1, 5.4.
    Pointers and arrays
    Pointers; constants
    History of C++
    Introduction to pointers
    4 February 5 Weiss 2.1-2.2.
    Stroustrup 5.2-5.3, 5.5-5.6, 10.1-10.3.
    Classes and objects
    Arrays, pointers, references, classes
    Variable and pointer lifetimes
    February 7 No reading assignment Arrays and pointers
    5 February 12 Weiss 1.4, D.2, 2.3-2.7.
    Stroustrup 6.2.6-, 6.4, 10.4-10.5.
    New/delete; more on classes
    Free store, constructors, objects
    New and delete
    February 14 Kernighan & Pike, Chapters 5-6. 48 Debugging
    6 February 19 Weiss, Chapter 6. 30 Complexity Complexity Analysis
    February 21 No reading assignment
    7 February 26 Weiss, Chapter 4. 30 Inheritance Make
    February 28 Stroustrup, Chapter 12. 26 Object-oriented programming using C++
    8 March 5 Stroustrup, Chapter 11. 40 Operator overloading Operator overloading
    March 7 Weiss, Chapter 5. 31 Design patterns Iterators
    March 12 Spring break
    March 14
    9 March 19 No reading assignment Midterm post-mortem
    March 21 Weiss, Chapter 3.
    Stroustrup, Chapter 13.
    Templates Templates
    10 March 26 Weiss, Chapter 16. 24 Stacks and queues Lists, stacks, queues, and deques
    March 28 No class
    11 April 2 Weiss, Chapter 20. 24 Hash tables Hash tables
    April 4 Weiss, Chapter 18. 32 Trees Trees and tree representation
    12 April 9 Weiss, Sections 19.1-19.3. 20 Binary search trees Binary search trees
    April 11 Weiss, Sections 19.4-19.6. 32 Balanced binary trees AVL trees
    13 April 16 Weiss, 19.7-19.8. 24 B-trees B-trees
    April 18 Weiss, Chapter 7. 28 STL STL
    14 April 23 Presentation Days -- No class
    April 25
    15 April 30 Reserved for slippage (material TBA)
    May 2

    Administrative Matters

    See the administrivia page for details of administrative matters:

    You are responsible for being familiar with the contents of the administrivia page!

    Class Suggestion Box

    If you have questions that you prefer not to ask during class, or suggestions that you would rather have remain anonymous, there is now a class suggestion box on the Web. This interface will allow you to send e-mail to Prof. Kuenning such that it appears to have also come from him, instead of from yourself.

    © 2001, Geoff Kuenning

    This page is maintained by Geoff Kuenning.