CSCI 241 - Data Structures

Scott Wehrwein

Spring 2022

Course Overview

Who

Where and When

Lecture and Lab

CRN Lecture (ES 418) Lab (CF 165)
20321 MWF 9:00–9:50am T 8:00am–9:50am (with Grant Chou)
21335 MWF 9:00–9:50am M 10:00–11:50am (with Matt Jensen)
21882 MWF 10:00–10:50am M 8:00–9:50am (with Matt Jensen)
21883 MWF 10:00–10:50am T 10:00–11:50am (with Matt Jensen)

Office Hours

What

Synopsis from the WWU Course Catalog

Design and implementation of hash tables, general trees, search trees, balanced trees and graphs. Comparison of sorting algorithms. Demonstration of the use of data structures in various applications. Evaluation of the best data structure for a particular task. Programming is required in implementation of concepts.

Official Course Outcomes

At the end of this course, students will have:

Why

The goal of this course is to round out your knowledge of the fundamental data structures and algorithms that comprise the basic toolbox of a computer scientist or software developer. Along the way, we’ll encounter and develop the following big ideas that permeate many more advanced subfields of computer science:

By the end of this course, students should be able to:

Textbooks

The following texts may serve as useful references, but are not required:

Flipped Course Format

The Lecture component of this course is “flipped”. For most class periods, you will do the following:

  1. Before a given class period, watch the (usually 3) pre-recorded lecture videos.

  2. After each lecture video, complete a short set of Exercises to test your understanding of the new content. You will submit the completed exercises to Canvas before class, to be graded for completion only.

  3. In class, most of your time will be spent in groups:

    Common questions and clarifications may be discussed as a whole class.

Lecture videos will be posted on YouTube and linked from the Schedule table, alongside the Exercises, Problems, and optional readings for each class period.

Assessment

Grade Breakdown

Grades will be calculated as a weighted average of scores on the following course components, each of which is described in more detail below:

In this class we follow the notational convention that a range of integers denoted a..b describes the range beginning at (and including) a up to but not including b (this is consistent with Python’s range function). For example, 1..4 describes the range including 1, 2, and 3 but not 4. The floor function truncates the decimal part of a floating-point value (that is, rounds down to the nearest smaller integer). Final letter grades will be assigned as follows.

floor(%) Grade
 ≥ 90 A range
80..90 B range
70..80 C range
60..70 D
0..60 F

The calculated raw percentages may be curved nonlinearly at the instructor’s discretion, but any such curve used will not reduce anyone’s grade. “+” or “-” cutoffs will be decided at the instructor’s discretion.

Programming Assignments

Four programming assignments will be given to provide practice implementing the major concepts covered in the course:

Resubmissions

You may resubmit any programming assignment (i.e., A1, A2, A3, A4) within two weeks of when grades are released (or the day of the final exam, whichever is earlier) to earn back up to half of the unit test points you lost. Only unit test points can be earned back. When you resubmit, you must send me an email to let me know that you have done so.

Extra Credit: Test Suite Gaps

In any of the programming assignments where unit tests are provided, you can earn extra credit if you discover a gap in my test suite. Specifically, if you discover that your implementation passes the provided test cases up to and including the tests for a given method but that method still has a bug, you can earn up to 3 points of extra credit for providing a correct test case that catches the bug.

If you find such a bug and wish to earn extra credit:

  1. With the bug present in your solution code, Create a testing branch in your repository (git checkout -b testing).
  2. Modify the appropriate testing class to include your additional test case. When this test file is run, your test should be the only one up to that point in the test file that fails (unrelated tests from later in the assignment may fail as well).
  3. Commit your test file changes and push your testing branch to github and send me an email me with a detailed description of the bug and the test you’ve written. Please also include a link to your repository.

You can send your test case in anytime starting before the assignment is completed (create your testing branch then simply swich back to master, fix the bug, and continue on) up until 5pm on the last day of classes.

Labs

Weekly labs will provide hands-on experience with auxiliary topics as well as time for work on programming assignments with the TA available to answer questions during the lab period. To get full credit for a lab activity, you must both attend lab and hand in the deliverable by the deadline, which will typically be 10:00pm on the Sunday following the lab period. If you have a legitimate reason for missing lab, contact me ahead of time. Attending a lab section other than the one you are registered for requires permission from both me and both lab TAs. Barring case-by-case exceptions, if you miss lab but submit the deliverable on time you will receive half credit (i.e., your score will be multiplied by 0.5). This penalty (for non-attendance, not for non-completion) will be waived for one lab. No late labs will be accepted.

Quizzes

Weekly quizzes will be given most Fridays after the first week, covering material up to but not including that day’s topic. I have a strict policy against makeup quizzes, but your lowest quiz grade will be dropped. If some special circumstances cause you to miss taking more than one quiz, please talk to me.

Exams

The midterm exam will be in class on Friday, May 6th.

The final exams are scheduled as follows:

The format of the final will match the midterm, except that the duration is longer. The final exam will be cumulative, but more emphasis will be placed on material covered since the midterm. Per the University Academic Policies, a student who fails to take a final examination without making prior arrangements acceptable to the instructor receives a failing grade for the course.

Lecture Exercises

Before each class, you will watch up to three short videos and work through a set of Exercises that test your understanding of the material from the videos. Your individual exercise solutions, submitted prior to class, will be graded for completion and will make up 5% of your grade. You can miss up to three of these submissions without penalty.

In class, your team will get together and collaboratively write a solution set for the exercises. The group’s solution set will be handed in by the end of class and graded for correctness, making up another 5% of your grade. You can miss up to three class periods and still get credit for the work your group does; after that, you will not recieve credit for missed in-class work.

Note that the Exercises to be completed before lecture are distinct from Problems, which you will work on in class after finishing your collective Exercise solution set. Grades will be based only on Exercises, not Problems - the Problems are designed to challenge you, so I do not expect that all groups will be able to finish all of them.

Resources for Getting Help and Support

Help with Course Content

If you are stuck, struggling, or need help on any aspect of the course, you have several avenues for seeking help:

Community Office Hours

Faculty Community Ambassador - Moushumi Sharmin

As we navigate this unnatural environment, it is creating a lot of stress and anxiety for many of us. If you want to share your views/concerns/comments related to EID issues, the climate of the department, or just need a space to talk about things that you need someone else to listen to, please feel free to join me in the Community Hours.

This hour is for Students, Faculty, and Staff. The conversations that will happen in the room will be strictly confidential and one-on-one (unless it is previously agreed that a group of individuals want to join at the same time).

Time: Thursdays at 10am (or by appointment)

Zoom link: https://wwu-edu.zoom.us/j/161683671?pwd=anhINUdwRUc1cmdPaTJqSXJMRFl0dz09

Student Community Ambassador - TBD

University Resources

As a reminder, the following University resources are always available:

Logistics

Course Webpage / Syllabus

The Schedule section of this page will be kept up-to-date as the quarter progresses with topics, links to all lecture materials (videos, slides, exercises, problems, and readings), as well as links to assignment and lab handouts. I suggest bookmarking this page (including the #schedule at the end will link you straight to that part of the page); if you forget the URL and need to find your way back here, you can find the link on the Syllabus page in Canvas.

Computer Labs

The CS department maintains a set of Computer Science computer labs separate from the general university labs. These systems are all set up with the software that you need to complete the work for this class.

CS Accounts
To log into the machines in these labs, you will need a separate Computer Science account, which you’ll already have if you’ve previously taken another CS course at Western. If you haven’t taken a CS course at Western before, this will be created for you in the first week of classes. Your username will be the same as your WWU username, but you will need to activate your account and set a new password by visiting http://password.cs.wwu.edu. Note that you’ll need to do this before your first lab, since you’ll be unable to log into the computers to access a web browser until you’ve done this.

Lab Locations and Access
The following rooms in Communications Facility are CS Department labs: 162, 164, 165, 167, 405, 418, 420. These labs are open to all CS students (that’s you!) any time except when scheduled for a class or other activity. The complete of CS labs and their schedules can be found on the CS Support Wiki. CF 405 is never booked, so it’s always available. Labs are open 24/7, although the building locks at 11pm so you won’t be able to enter later than that.

Using Labs Remotely

Please see the Remote Access Instructions for details on how to work remotely in the CS lab environment.

Canvas

We will use Canvas for announcements, assignment invitation links, grades, and some other logistics. Lab and assignment writeups, lecture materials, readings, etc. will all be linked from the course webpage. Numerical grades will be entered into Canvas to track your overall score in the course, but feedback on your assignments will be provided via Gradescope (quizzes and exams) or Git (assignments and labs), as described in the sections below.

Gradescope

Quizzes and exams will be graded and returned to you via an online tool called Gradescope. You will receive an email before the first quiz with instructions on how to set a password for the account that has been created for you. Thereafter, you can access quizzes and exams by logging into your account on http://www.gradescope.com.

Git and GitHub

Labs and assignments will be completed using Git repositories hosted by GitHub and orchestrated by GitHub classroom. For each assignment and lab, you will find an invitation link in the assignment page on Canvas. This link will create your private repository where you will complete the assignment in a local copy of the repo, and submit your code by pushing your final changes to GitHub. To complete your submission, you will also fill out a Canvas survey letting me know how many hours you spent on the assignment.

To grade your assignments (and in some cases, labs) Github Classroom automatically creates a feedback branch in your repository and a pull request to merge all the commits you’ve made to master into the feedback branch. This allows us to use Github’s code review tools to give you feedback directly in your repository. To access your feedback, go to your repository on github.com click “Pull Requests” from among the tabs across the top, then click “Feedback” in the list on that page. You should see a log of comments and feedback, including line-by-line comments if we’ve left any.

For the assignments with unit tests, we’ve also set up Github Classroom to automatically run your code on those tests every time you push your changes to github. This is a form of continuous integration testing, which is a fancy term for “run ALL the tests every time you change anything”. You’ll probably get emails telling you the outcome of the checks (which will only be successful if you pass all tests); I think there’s a way to unsubscribe from them, or you can use an email filter to keep your inbox clutter to a minimum.

Communication

I will make every effort to make all course-related announcements via Canvas. It is your responsibility to make sure that you promptly become aware of Canvas Announcements as they are posted; Canvas should be configured to send you an email notification by default, but if you are unsure, please come see me in office hours.

Feedback

I take student feedback seriously. I appreciate any feedback you’re willing to give, and I will do my best to act on constructive feedback when possible. I will solicit feedback through surveys periodically throughout the course, but you are welcome and encouraged to provide feedback anytime in my office hours, by email, or if you desire anonymity you can fill out this Google Form.

Schedule

This table contains a schedule of topics and links to all course materials. Rows in the future should be considered tentative and subject to change.

Date # Videos Slides E/P Topic Assigned/Due References
3/30 (0) 0 Problems Intro, logistics
4/1 1 A: 5:18
B: 13:14
C: 9:21
A
B
C
Exercises
Problems
Tools for algorithms, Searching
announcements
RS 13.2-13.3, CLRS 2.1-2.2
4/4 (1) 2 A: 9:42
B: 10:18
C: 19:13
A
B
C
Exercises
Problems
Runtime analysis
announcements
Lab 1:
Git, Gradle
RS 13.2-13.3, CLRS 2.2
4/6 3 A: 9:45
B: 10:26
C: 15:02
A
B
C
Exercises
Problems
Insertion and selection sort
announcements
A1 out RS 13.2-13.3, CLRS 2.1-2.2
4/8 4 A: 4:19
B: 8:20
C: 5:14
A
B
C
Exercises
Problems
Recursion
announcements
Quiz 1 Tutorial: Method execution
RS 12.1-12.3
4/11 (2) 5 A: 6:59
B: 7:15
C: 8:24
A
B
C
Exercises
Problems
MergeSort Lab 2:
Testing
lab2 hashmap hints
RS 13.4, CLRS 2.3
4/13 6 A: 10:42
B: 5:27
C: 6:14
A
B
C
Exercises
Problems
Quicksort, Stability, Space Complexity
announcements
CLRS 7.1
4/15 7 A: 13:26 A Exercises
Problems
Comparison Sorts
Radix Sort
announcements
Quiz 2 CLRS 8.2-8.4
4/18 (3) 8 A: 7:50
B: 4:59
C: 6:10
A
B
C
Exercises
Problems
Trees, Traversals,
Recursion on trees
announcements
Lab 3:
Recursion
RS 17.1-17.3
4/20 Problems Buffer day - fun coding problems!
4/22 9 A: 9:52
B: 8:21
C: 6:44
A
B
C
Exercises
Problems
Binary Search Trees A1 due
Quiz 3–>Mon
CLRS 12.1-12.3
RS 17.4
4/25 (4) 10 A: 9:54
B: 5:01
C: 9:26
A
B
C
Quiz 3
Exercises
Problems
Generics
Tree Rotations
Lab 4: AList
A2 out
<–(Quiz 3)
CLRS 13.2
4/27 11 A: 6:20
B: 9:19
A
B
Exercises
Problems
AVL Trees
announcements
Eric Alexander’s AVL Tree Notes
4/29 12 A: 4:31
B: 8:42
C: 3:39
A
B
C
Exercises
Problems
Heaps
announcements
Quiz 4 RS 18.2; CLRS 6.1-6.3
5/2 (5) 13 (None) (none) (No Exercises)
Problems
Heapsort Lab:
Midterm Review
RS 18.2; CLRS 6.1-6.3
5/4 Buffer day
5/6 Midterm Exam
5/9 (6) 14 A: 3:57
B: 6:23
C: 4:05
A
B
C
Exercises
Problems
Hashing 1
announcements
Lab 5: Hash functions
A2 Due
A3 out
RS 18.1; CLRS 11.1-3
5/11 15 A: 5:23
B: 3:45
C: 4:16
A
B
C
Exercises
Problems
Hashing 2 CLRS 11.3-4
5/13 16 A: 6:44
B: 4:35
C: 2:13
A
B
C
Exercises
Problems
Graphs: definition, representation
announcements
Quiz 5 CLRS 22.1-2
5/16 (7) 17 A: 6:12
B: 3:05
C: 2:37
L17P
A
B
C
Exercises
Problems
Graph traversals Lab 6:
Connected Components
CLRS 22.3
5/18 18 A: 12:37
B: 3:45
C: 3:17
A
B
C
Exercises
Problems
Dijkstra’s algorithm
announcements
CLRS 24.3
5/20 19 A: 6:40
B: 10:42
C: 12:21
A
B
C
Exercises
Problems
Tries
announcements
Quiz 6
5/23 (8) 20 A: 9:14
B: 7:34
A
B
Exercises
(Work on Lab 7)
Huffman Coding Trees Lab 7: Huffman Coding
A3 due
A4 out
CLRS 16.3
5/25 A: 9:43 A (No Exercises)
Problem
Dijkstra: Proof CLRS 24.5
5/27 (Work on Lab 7) Quiz 7
5/30 (9) No class - Memorial Day No Lab: Memorial Day
A4 due
6/1 Coding Interview Problems
6/3 No new material; Ask me Anything!
6/8 (Wednesday) Final Exam - 9am section
10:30 - 12:30pm
6/9 (Thursday) Final Exam - 10am section
10:30 - 12:30pm

Course Policies

Inclusive Classroom Environment

It is expected that everyone will promote a friendly, supportive, and respectful environment in the classroom, labs, and project groups. Everyone’s participation will be equally welcomed and valued.

Attendance

As described above in the Assessment section, you are expected to attend both class and lab. Up to three absences from class will not affect your grade; additional absences will cause deductions on the in-class portion of your grade. For labs, the 50% absence penalty will be waived for at most one lab. If you have reasons that you need to miss class or lab beyond these limits, please talk to me about case-by-case exceptions.

Late Work

You have three “slip days” that you may use at your discretion to submit programming assignments late. Slip days apply only to programming assignments and can not be applied to any other deadline, including labs. You may use slip days one at a time or together - for example, you might submit each of three assignments one day late, or submit one assignment three days late. A slip day moves the deadline by exactly 24 hours from the original deadline; if you go beyond this, you will need to use a second slip day, if available.

After your slip days are exhausted, a penalty of 10% * floor(hours_late/24 + 1) - that is, 10% per day late unless you contact me to discuss an additional extension.

How to Submit Late

Submission of assignments is done by (1) pushing your final changes to Github and (2) filling out a Survey quiz on Canvas. To submit late, you don’t need to let me know: simply don’t submit the Canvas survey until you are done. Slip days will be applied automatically based on when you submitted the survey; your grader will note the number of slip days applied in your feedback.

Programming Guidelines

Your programs will be graded on correctness, clarity, and efficiency (in that order).

Correctness:

A correct program is one that always produces the correct output for a given input. Also, a correct program does not produce unintended side-effects. The most effective way to ensure that your program is correct is to test, test, test. Test each component as you introduce it; once you are confident that a component works you can use it in other routines. Try to break your program in testing, and if you succeed, locate the bug and fix it. The better you test your program, the more likely it is to be correct - the more likely it is to be correct, the more likely you’ll earn a good score. Most of your grade will depend on the correctness of your code.

Clarity:

The easier it is to read and maintain your code, the easier it is to locate and remove bugs. Your program should be well organized, appropriately commented, and easy to maintain. To have a well-organized program, design your program thoughtfully and modularly. Think before you code: hacking away blindly leads to ugly, difficult-to-read code. If you do hack away, producing a functional but ugly wall of code, try to clean it up a bit. Make sure that your cleaning does not introduce new bugs.

As for comments, please follow these simple guidelines proposed by Emeritus Professor Osborne:

Efficiency:

Your programs should be asymptotically efficient, e.g. checking graph reflexivity should be O(n), insertion into a balanced tree should be O(log n), etc. Do not optimize your code beyond the asymptotic level, as such tweaks are often at the expense of clarity, correctness, or both.

Academic Honesty

Collaboration Policy - Individual Assignments

Individual programming assignments are to be completed independently. Students are welcome to discuss assignments with each other on a conceptual level, but each student should be writing their code independently and without direct help from fellow students. Sharing your code with others or looking at someone else’s code is an explicit violation of this collaboration policy. To make sure you are collaborating appropriately, follow these two rules:

Automated tools will be used to check your code for plagiarism at the push of a button. They are not fooled by tricks such as changing variable naming and whitespace: in fact, hiding plagiarism is harder than doing the assignment.

University Policies

Please review the University policies outlined at http://syllabi.wwu.edu regarding: