Lab 6: Implementing a Map with a BST

Due Date: Mon 11 Dec, 23:59. Note the change from the usual Tuesday!


Background

Lab 6 will provide you an opportunity to work with binary search trees (BSTs). You are to implement a map (a container that allows associations between keys and values) via a binary search tree. Similar to Lab 3, you may want to implement the destructor/copy constructor/assignment operator after you've gotten everything else working. Our associations are between andrew-ids (strings) and student information (name and year). An interesting feature of maps is the overloading of the [ ] operator (called the indexing operator) to allow easy access to the value mapped to a key. The textbook discusses maps on pages 251-252. The Set mastery problems can be effectively modeled on this assignment.


What You'll Need

Download the lab6.zip file from the 15-113 course web site. Save the zip file to your temp directory and unzip the files. You should see the following files:


Assignment

The operations you are to implement are the following: The current driver exercises some functionality. Make sure that you write code that exercises all the commands present in the assignment.

Sample Output

The output of operator<< on the initial tree created from small-stu.txt:

ubardak -> ULAS BARDAK 4
chiang -> MENG-YANG CHIANG 4
ymb -> YEVGENY BOKK 4
balaji -> BALAJI SARPESHKAR 2
minsun -> MINSUN JEONG 1
alwong -> ANGELINE WONG 2
flo -> FRANCIS LO 1
rlie -> RIDY LIE 1
dwexler -> DJANGO WEXLER 2
fning -> FRANCES NING 3
nbr -> NITHIN REDDY 2
sss -> SEEMA SHAH 3
danielf -> DANIEL FERNANDEZ 1
jsaks -> JEVAN SAKS 2
clt -> CHRISTOPHER TUTTLE 2
ddf -> DMITRY FRUMKIN 3
ggp -> GEOFFREY PLITT 2
kgm -> KEVIN MILANS 3


Handing in your Solution

Your solution should be in the form of a .zip file. When we grade your solution we will unzip the folder and execute the project.

Your Solution zip file must contain (only) the following files

  1. lab6.mcp
  2. map.cpp
  3. map.h
Note that there's no need to submit your map-test.cpp. I have my own test driver to run against your code...

Use the Intro Programming dropoff form to submit your zip file.