2009 June 1 / jj|d|a|v|i|s|@|c|a|r|l|e|t|o|n|.|e|d|u

Data Structures

Carleton College CS 201, Spring 2009, Prof. Joshua R. Davis


This is a second course in computer science. The focus is on data structures, which are used to organize information in computer programs. Examples include stacks, queues, trees, graphs, and hash tables. For each data structure, our goal is to understand both its theoretical properties and its practical value. We perform a mathematical analysis of its efficiency, and we apply the data structure to a concrete programming problem. Indeed, most of the assignments in this course take the form of programs, in Python.

The official prerequisite is CS 111. More generally, this course is appropriate for students who are comfortable with programming, including recursion and objects, and who have not taken more advanced courses. Talk to me if you are concerned about your background.

Our class meets in CMC 209 during period 4A (MW 12:30PM-1:40PM, F 1:10PM-2:10PM). The basic materials are

Here's how you get in contact with me:

Dr. Joshua R. Davis (most people call me Josh)
E-mail: jj|d|a|v|i|s|@|c|a|r|l|e|t|o|n|.|e|d|u
Office: CMC 327, x4482
Office hours: Mon 3:00-3:50, Tue 2:00-2:50, Wed 3:00-3:50, Thu 1:00-1:50. You can also make an appointment; simply pick a free time from my weekly schedule and e-mail me. You can also talk to me after class.

Eric Alexander, a junior CS major, is the prefect for this course. As a prefect, he holds a couple of review sessions each week, in which you review material from class, get questions answered, tackle additional problems, etc. He is also available for individual tutoring.

Additionally, our computer lab (CMC 306) is often staffed with CS majors who serve as lab assistants. They can help you with technical computer problems ("How do I run my Python program?") as well as conceptual questions about assignments.


Final grades (A, B, C, etc.) are assigned according to an approximate curving process. By this I mean that there are no predetermined percentages (90%, 80%, 70%, etc.) required for specific grades. The following elements contribute to the final grade.

You are expected to spend at least 10 hours per week on this course outside class. Some students may need to spend more than 10 hours. If you are spending more than, say, 15, then talk to me. If you are spending fewer than 10, then your education is suboptimal; we should discuss ways to enrich it, such as extra readings or side projects based on your personal interests.

Working With Others

For some assignments the students are expected to work in pairs. Your pair hands in a single copy of the assignment with both names on it. You are encouraged to talk with other pairs — to bounce ideas off them, for example — but the work that you submit must be the work of your own pair. The two members of a pair must contribute roughly equally.

Other assignments are individualized, in that each student hands in her own work. Even on these assignments you are encouraged to talk with other students. However, you should write up your work separately, in your own words.

In short, you may not copy someone else's work or allow them to copy yours. Presenting someone else's work as your own is an act of Academic Dishonesty.

Special Accommodations

During the term, you have one free pass to hand in an assignment late. Here is how you activate it. Instead of handing in the assignment, send me e-mail (by the due date) declaring that you are using your late pass and proposing a new due date. If the due date is extended by only one class meeting, then no explanation is necessary; if you need longer, then convince me. Use your free pass wisely; once you have used it, no late assignments are accepted, except in extreme circumstances that are truly beyond your control.

If some medical condition affects your participation in class or your taking of exams, let me know during the first week of class. You may need to make official arrangements with the Office of Disability Services.


M 3/30011.1-1.3introduction, setsIntroductionset.py
W 4/01021.4-1.7PythonTic Tac Toe
F 4/03037.2linked lists, arrays
M 4/06044.1-4.2.1efficiencyEfficiency
W 4/08052.3stacksstack.py
F 4/10062.4queuesWell-Formed XMLqueue.py, radixsort.py
M 4/13073.1-3.3recursiongcd.py, debug.py
W 4/15083.4- Mazeshanoi.py, Hanoi.zip
F 4/17095.1-5.4treesbinarytree.py, tree.py
M 4/20105.5.1parsingparser.py
W 4/2211Exam 1
F 4/2412evaluationInterpretationsyntaxsemantics.py
M 4/27135.5.2tree traversal
W 4/29145.6binary search treesbinarysearchtree.py, dictionarybst.py
F 5/0115AVL treesColor Histogramstree-balancing applet
M 5/04Midterm Break
W 5/06164.3.3hash tableshash table applet
F 5/0817hash tableshashtable.py, QHash, GHashTable, NSDictionary, .NET Dictionary
M 5/11186.1-6.3graphsSearch With Contextgraph.py
W 5/13196.4.1breadth-first search
F 5/15206.4.2depth-first search, topological sortCS Course Graph 2009-2010
M 5/18216.4.5Dijkstra's algorithmExam 2
W 5/20225.7binary heaps, priority queues
F 5/2223building heaps, heap sortFinal Projectheap sort applet
M 5/2524project work
W 5/2725implementing Python
F 5/2926project work, progress report
M 6/0127quick sort
W 6/0328conclusion, progress report
S 6/06Final Project due 11:00AM