CS140 -- Lab A

This lab builds on the Binary Search Tree data structure from the lecture notes on trees. In particular, I have copied bstree.h, bstree.cpp and bstree_test.cpp to laba.h, laba.cpp, laba_test.cpp respectively. I then added some public and protected methods to laba.h. Your job is to implement them in laba.cpp: Your job is to implement these methods in laba.cpp. That is the file that you should submit. You are not allowed to modify laba.h or laba_test.cpp.

The testing program

The program that we will use in the gradescript is laba_test.cpp. It is simply an augmentation of bstree_test from the binary search tree lecture notes. It has additional commands for each of the methods that you are implementing. So:
UNIX> laba_test LABA':'
LABA: INSERT Adam Resistant 833-118-4192 470-10-0161
LABA: INSERT Dylan Politician 451-532-5606 940-23-2116
LABA: INSERT Kaitlyn Fortescue 323-215-8830 975-92-4704
LABA: PRINT
    Kaitlyn Fortescue
  Dylan Politician
Adam Resistant
LABA: INSERT Brianna Quintillion 537-619-7786 208-57-2191
LABA: PRINT
    Kaitlyn Fortescue
  Dylan Politician
    Brianna Quintillion
Adam Resistant
LABA: POSTORDER
    Brianna Quintillion
    Kaitlyn Fortescue
  Dylan Politician
Adam Resistant
LABA: PREORDER
Adam Resistant
  Dylan Politician
    Brianna Quintillion
    Kaitlyn Fortescue
LABA: HEIGHT
2
LABA: DEPTH Adam Resistant
0
LABA: DEPTH Brianna Quintillion
2
LABA: DEPTH Dylan Politician
1
LABA: ISAVL
No
LABA: ROTATE Dylan Politician
Rotated.
LABA: PRINT
  Kaitlyn Fortescue
Dylan Politician
    Brianna Quintillion
  Adam Resistant
LABA: ISAVL
Yes
LABA: QUIT
UNIX> 
The grading script does the following: