Data Structures

About the course

This is the homepage for CS 241: Data Structures, a course offered by Fritz Ruehr at the Computer Science Department of Willamette University.

The study of data structures and algorithms serves as a basic foundation to a Computer Science education. As a second course in programming, it enriches a student's understanding of the basic processes involved in computing. But it also begins to focus attention on deeper and more abiding issues. In this course, we shift our attention from simple coding techniques to the analysis of algorithms in terms of resource use (time and space), generic solutions to recurring problems, and larger-scale program design. A good portion of our time will be spent becoming familiar with the discipline's standard repertoire of data structures and algorithms. In order to support larger-scale design, we will stress principles of abstraction and modularity. We will try to divide our programs into cleanly-separated components, with narrow interfaces, and consider the specification of their behavior separate from their possible implementations. Through all of this, our programming vehicle will be the modern, high-level programming language Python. Students should come out of this course with a solid capability for programming and design and a good foundation for future study of Computer Science in general.

News

Welcome to the Fall 2020 teaching of the course!

As the semester progresses, new News items will be added to the top of this section, after the line below, so that the most recent ones appear first. You should thus get in the habit of coming to this page to check the top of the News for announcements, etc.

I have kept the old news items from earlier teachings of the course and the most recent one (Fall 2019) intact below, in a separate section, just in case we need them.

(Note that previous versions of the course were taught in Java; the Fall 2020 version is the first to be taught in Python.)


Current work (reading, lecture, and lab)

Study for the final exam using these review notes for the Fall 2020 final exam.

Reading: read Chapter 5, sections 5.1-5.2 on searching.

In lecture: we’ll talk about Chapter 5.

Lab: You may be finishing up the Lab 3: Striking Sequences via DCLLs lab or starting Royal Succession Order lab..


Hereafter starts the Old News part of the section …

Labs and written homework (in reverse chron. order)

Some on-line references

Current work archive

Third week of classes

Reading: Chapter 2 of the textbook, and bring questions about O-notation.

Coding: Be ready to ask questions about or demo your program for the skiing paths. We will start looking into the next program (Clicking on Windows) for next week.

Second week of classes

Reading: Chapter 1 of the textbook and bring questions about Python features.

And read specifically about classes, objects, and methods, toward the end of Chapter 1.

Coding: You are too imagine that you are writing a program to take, as input, a series of points (pairs of x and y coordinates) representing a “looped path” from the first point, along line segments represented by each pair of points, and returning in the end from the last to the first. Ultimately we may worry about a way to read these values in, but for now we will just work on two functions, each of which takes the same list of pairs (of numbers) as arguments.

The first function should compute the distance along the whole path (including looping back to the first point); you should write and use a distance “helper function” which takes two points and returns the distance between them. The second function will test a more subtle aspect of the same list of points: does the path hat they form ever cross over itself, either in the sense of two segments intersecting, or in the sense even of a single point at a “juncture” of two segments at their ends touching (having an endpoint in common), except of course in the case when two adjacent segments touch in order to form the path. This function should at least return a boolean values indicating whether or not the path is “good” (no unexpected crossings). If possible, you might return instead a list of the problematic crossing points, which would be empty if the path is good.

In lecture: we’ll talk about:

Reading: continue with Chapter 3 of the textbook, reading about stacks, their implementation, and balancing parentheses.

In lecture: we’ll talk about the material from Chapter 3.

Lab: We will try to finish up the Clicking on Windows lab—you don’t need to come to lab unless you have work still to do on the Windows lab.

Miscellaneous links

Here are a few fun, interesting or otherwise difficult-to-categorize links that came up in lecture at various points.