In this project you will be implementing association lists in C++. This project will give you some basic experience with building data structures in C++ (one of its most common uses). This will likely require that you do some reading on your own to understand how C++ classes work.

Getting the project

Follow the steps at the end of the previous video. Get the autograder by cloning the submission repo here. Be sure to read the instructions in that repository (in particular, read about how to make sure itโ€™s working).

Letโ€™s say that you have the autograder submit script stored in ~/projects/submit/submit.py. Then you will create a new directory, p0, for this project somewhere. Hereโ€™s what I did to set up the projects (note that I put them in ~/projects/cs245-playground, I recommend you just use a folder like ~/projects/cs245/p0`):

Kristophers-Air:projects kmicinski$ mkdir cs245-playground
Kristophers-Air:projects kmicinski$ cd cs245-playground/
Kristophers-Air:cs245-playground kmicinski$ mkdir p0
Kristophers-Air:cs245-playground kmicinski$ cd p0/
Kristophers-Air:p0 kmicinski$ cp ~/projects/submit/submit.py .
Kristophers-Air:p0 kmicinski$ python3 submit.py

   _____       __              __ __
  / ___/__  __/ /_  ____ ___  /_/ /_
  \__ \/ / / / __ \/ __ `__ \/ / __/
 ___/ / /_/ / /_/ / / / / / / / /_
/____/\____/_____/_/ /_/ /_/_/\__/   (by Kris+Tom)

? This directory is empty, would you like to initialize a new project?
  Yes
>>> Initializing `credentials` and `.gitignore` files <<<

    Note: it is very important that you do not do not
    distribute the `credentials` file. It stores your username and
    password. Please avoid sending it to anyone (doing so will be
    considered a violation of the honor code) or checking it into
    git.
? What is your username?  ktest
? What is your password?  **********
Verifying password...
>>> Login successful! <<<
Downloading available projects...
>>> Here are the available projects for your course <<<

    You must select the project whose shortname is the same as the
    name of this directory. If you want to work on a project not
    listed here (e.g., `proj0`), you must crate an empty directory
    with that name and run `submit.py` from that directory.
? Here are the available assignments, confirm you will select the curr
>>> Downloading starter files... <<<
>>> Unpacking starter files... <<<
Executing tar xvvf starter.tar.gz; rm starter.tar.gz
๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰ Starter files now ready! ๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰

     You are now all set up. We also recommend creating a (private) git
     ...

Completing the project

Project instructions are given in the top of file AssocList.h. Please read the instructions there and complete the methods marked TODO in the file. The purpose of the lab is to have you implement association lists: key/value maps based on lists of (key,value) pairs.

Running the lab yourself

If you want to test your program as you go, you first need to compile a test. Each test file is written as one of the file in the tests folder. You are encouraged to write your own, and the project includes secret tests (that you wonโ€™t be given)

# Compile the test and create file output
clang++ -std=c++14 -Wall -o ./output ./tests/<testname>.cpp
# Run the test
./output