161 Lab 4 exercises

See the main lab page for submission deadlines and late penalties.

It is assumed you are keeping up to date with the lectures and labs.

The focus for this lab is on dynamic data structures (linked lists and stacks) and an introduction to C++ classes.

The sequence for obtaining the lab will be much the same as previous labs, and the commands are briefly summaried below (see the lab1 discussion for explanations and any troubleshooting needed):
ssh -x csci fork csci161/lab4 csci161/$USER/lab4
cd csci161
git clone csci:csci161/$USER/lab4
cd lab4
Similarly, the sequence to add/commit/push your lab work is similar to previous labs:
git add dllist.cpp
git add postfix.cpp
git commit -m "...some message describing your changes..."
git push


Repo organization

There are actually two seperate programs using eight different C++ files: The provided makefile can be used to compile either/both of the two executables, using make postfix, make sortlist, or make all

Six of the eight files are complete, you'll be finishing the remaining functions/methods in two:


Program overviews


Specifications/requirements


Testing your programs

For postfix, you'll need to test your code with a variety of valid/invalid postfix expressions to check if your processEntry is correctly pushing numbers into the stack and correctly popping/applying/pushing when operators are encountered.

For sortlist you'll need to test with a variety of lists (#s to insert, # of removes) to ensure that your various dllist methods are all working correctly.