CS35: Data Structures and Algorithms

Lab 07 Notes

Lab 07 Agenda

Clone lab07

This is the same as previous labs. Remember to run ssh-add when you log in, so you don't get repeatedly asked for you ssh password. Go to the CS35 github org, to find the clone link for your repo on the web interface.
$ cd ~/cs35/labs
$ git clone <link you got from github> ./lab07

Setup Symbolic Link

Just like in previous labs, we establish a symbolic link to a shared directory that contains files to test your program. You can create the link by executing the following commands:
$ cd ~/cs35/labs/lab07
$ ln -s /usr/local/doc/lab07-data/ ./test_data

Note the path /usr/local/doc/lab07-data/ is local only to the machines on the CS network and will not work if you clone your code to your personal computer.

Written Part
Lab 07 is a two week lab. It will require knowledge of Dictionaries, BSTs, AVL Tree rotations, Priority Queues, and Binary Heaps. Some of this material will be covered in class during the first week of this lab and you may need to skip parts of this lab in the first week and complete it in the second week.

For the written part, you will be asked to draw some trees in $\LaTeX$. We provided a tool to make this easier. Edit the tree files and run make. If make generates an error with your trees, adjust the spacing between nodes.

When removing an element from an AVL tree, use the remove method described in lab 06. Before returning any node from removeFromSubtree run the balance algorithm described in class.

The written part involving heaps will likely need to wait until next week.

Coding Part

In the first week, you should mostly focus on the Document class which uses a Dictionary. The PlagiarismDetector class uses a PriorityQueue. Since a PQ implementation is provided for you, you can start using this relatively soon, after discussing PQs in class.

Command line arguments
main.cpp uses command line arguments. Let's looks at a simple demo of how they work. You will expand on this for your lab.