Homework 5: Snaking a Path through Linked Lists and Iterators
Teaser…
We're continuing our theme of linear data structures. Last assignment, we showed how a maze solver could use a stack or a queue to explore the maze in different ways. In this week's assignment, we'll be using linear data structures in an interactive Snake game!
Overview
In addition to having fun with the Snake game, in this week's assignment, you will practice
- Planning the design and implementation the IntList data structure.
- Developing testing strategies to uncover bugs in your code.
- Implementing a singly linked list, providing constant-time steque operations and more.
- Implementing an iterator for your linked list.
- Implementing a copy constructor, assignment operator, and comparison operator for your linked list.
- Analyzing the complexity of your code from a theoretical and empirical perspective.
Getting Started
This assignment is paired, and your repository belongs to your pair. We have already made it—there is nothing to accept and no name to agree on. Your pairing came from the pairing board, and the repository is named after your group. (It is the same pair as Homeworks 4 and 6.)
- Your group is
group (members ) - Your repository for Homework 5 is
repo - You can see it on the web at https://github.com/hmc-cs70-fall2026/
Both of you have push access to that one repository, so you are working in the same place rather than each having a copy to reconcile later.
The link says the page doesn't exist!
That usually means you are not in the CS 70 GitHub organization yet, rather than that your repository is missing. GitHub hides what you cannot see rather than admitting it is there.
So "not found" and "not allowed" look the same on purpose.
Exactly—so that nobody can go fishing for the names of private repositories. On the server,
cs70-fix-accesswill check your membership and sort most of this out for you.
Clone your repository on the CS 70 server to get started:
git clone https://github.com/hmc-cs70-fall2026/repo .git
Steps
- Part 1: Exploring the Snake Game
- Part 2: Designing the Queue Interface
- Part 3: Encoding an
IntList - Part 4: Implementing
IntList, Phase 1 - Part 5: Encoding an Iterator
- Part 6: Implementing
IntList, Phase 2 - Part 7: Implementing
IntList, Phase 3 - Part 8: Implementing
IntList, Phase 4 - Part 9: Written Questions
- Part 10: Check Your Work
Useful Information
Ask for (and give each other) help!
Post your questions there, and be sure to answer each other's. Even if you're not 100% sure of an answer, it's okay to jump in and try—we're all here to help each other!
Resources
You may find these resources helpful:
- Using
assert - Debugging Tips
- Also check out Using GDB if you want even more debugging power.
- Using
valgrindto Find Memory Leaks
Refresh your familiarity with the coding idioms we expect you to use:
(When logged in, completion status appears here.)