Assign5: Linked Lists

Due Tuesday, August 04 at 11:59 pm

Last week, we gained a lot of practice working with pointers in the context of arrays and dynamic memory allocation. This week, we are going to continue bolstering our pointer skills by working on some tasks centered around manipulating linked structures. Linked structures are a fundamentally different way of representing sequences than the array-based approaches you worked with in the last assignment, and this assignment aims to build your familiarity with the joys, trials, and tribulations of working with linked structures. Along the way, you'll also deepen your understanding of some different real-world sorting algorithms. By completing the following tasks you will become a master of pointers and linked structures, to the point where you'll finally be able to proclaim with confidence, Thank U->Next!

This assignment is to be completed individually. Working in pairs/groups is not permitted.

Learning goals

Assignment parts

This assignment consists of two debugging/warmup exercises (warmup.cpp and labryinth.cpp) and one programming task (sorting.cpp). To give you a sense of time allocation, completing the sorting portion of the assignment took the instructors about 3.5 times longer than the labyrinth exercise.

Getting started

We provide a ZIP of the starter project. Download the zip, extract the files, and open the project in Qt creator.

📦 Starter code

The source files you will edit are labyrinth.cpp and sorting.cpp.

Additionally, you will answer questions in short_answer.txt.

Before getting started writing code, we highly recommend reading the CS106B Style Guide. All of your assignment submissions this quarter will be graded on their coding style, and this guide contains the coding standards that make up our style rubric.

Helpful Resources

Here are some resources that you might find helpful for this assignment:

Getting help

Working very closely with raw memory, pointers, and linked data structures is a challenging task! We always recommend drawing lots of diagrams and making use of the debugger whenever possible. As always, we're here to help you if you get stuck. You can contact us on Ed, email your section leader, or stop by the virtual LaIR (here is the schedule of help hours). You can find more information about how to get help at the LaIR here. As a reminder, try to visit the LaIR for code debugging questions – however, if you cannot make it to the LaIR due to timezone issues, you can post on Ed to get help. However, you must use a private post if you are including code so that you are not posting your solutions for the whole class to see.


Before you call it done, run through our submission checklist to be sure all your ts are crossed and is dotted. Then upload your completed files for grading to the Paperless website.

Please submit only the files you edited; for this assignment, these files will be

🏁 Submit to Paperless

Note: When submitting to Paperless, due dates are expressed in PDT.