Due Tuesday, August 4 at 11:59 PM
- Submit to Paperless. Deadline is 11:59 PM.
- The late day policy gives you the ability to self-grant an extension (as long as you have not used all your late days); we trust you will make reasonable and sparing use of this power. Be sure to reserve late days for emergencies.
- Reminder: You have a limited pool of late days. You have a total of 4 late days to use throughout the quarter, but you cannot use more than 2 late days per assignment. Late days are expended in 24-hour blocks. See the Assignments page for more details.
Last week, you gained experience working with pointers in the context of arrays and dynamic memory allocation. This week, you'll continue to strengthen your pointer manipulation skills further by working with linked lists. Pointer-based linked structures are a fundamentally different way of representing sequences than the array-based approaches you worked with in the previous assignment, and this assignment aims to build your familiarity with the joys, trials, and tribulations of working with linked lists.
This assignment is to be completed individually. Working in pairs/groups is not permitted.
Learning goals
- Students will continue to build and improve their skills of working with pointers.
- Students will be able to use their knowledge of pointers to traverse and investigate linked data structures in the debugger.
- Students will understand the fundamental differences between storing data in contiguous memory location as compared to organizing data pointer links.
- Students will gain practice with different "idioms" of linked list usage, including pointer rewiring and insertion/removal of nodes from linked lists.
- Students will sharpen their computational problem solving skills as the work on slightly more open-ended problems than in previous assignments.
Assignment parts
This assignment consists of four parts: two warmup problems (warmup.cpp and labyrinth.cpp), followed by two small collections of linked list programming tasks (listystrings.cpp and garlands.cpp).
-
Setup: Get the Project Compiling!
Start here! You have to push through a quick setup task in order to get the starter project compiling.
-
Debugging Warmup: Memory Errors and Leaks
A collection of tools and strategies to prepare you for working with linked lists.
-
Debugging Adventure: Your Own Personal Labyrinth
Trace through pointers in the debugger to escape from a labyrinth that is custom-built just for you!
-
Listy Strings
A variety of coding exercises where we use linked lists to represent strings.
-
Garlands
A variety of linked list coding exercises that add an additional dimension to the listy strings.
Getting started
π¦ Starter project
The starter project is provided as a zip archive. Download the zip, extract the files, and move the project folder to your CS106B folder. Open the .pro file in Qt Creator to get started.
Resources
Here are resources that will be helpful for this assignment:
- The CS106B Style Guide
- A Guide to Testing Code in CS106B
- Common Build/Run Errors Guide, put together by one of our wonderful section leaders, Jillian Tang.
- Textbook Chapter 11 Pointers and Arrays, Chapter 12 Dynamic Memory Management
Getting help
Working very closely with raw memory, pointers, and linked data structures will be challenging. We recommend drawing lots of diagrams and making good use of the debugger.
As always, we're here to help you if you get stuck. The Ed forum is open 24/7 for general discussion. Always start by searching first to see if your question has already been asked and answered before making a new post. To troubleshoot a problem with your specific code, your best bet is to bring it to the LaIR helper hours or office hours.
Submit
Before you call it done, run through our submit checklist to be sure all your ts are crossed and is dotted. Then upload your completed files to Paperless for grading.
Please submit only the files you edited; for this assignment, these files will be
labyrinth.cpplistystrings.cppgarlands.cppshort_answer.txt
Super important note: After submission, double check that you have uploaded the correct files and not old versions of your work or blank copies. We do not accept re-submissions after the late deadline has passed.
π Submit to Paperless
Note: On Paperless, all due dates and submission times are expressed in Pacific time.