
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Instructions for lab 9 of computer science ii (csci 1200) focusing on binary search trees and recursion. Students are expected to have reviewed lectures 16 and 17 before starting. The lab involves examining the provided code in cs2set.h and test_cs2set.cpp, implementing a non-recursive replacement for the find function, and writing the copy_tree private member function for the copy constructor and assignment operator.
Typology: Lab Reports
1 / 1
This page cannot be seen from the preview
Don't miss anything!

This lab explores binary search trees and their implementation in the cs2set class, along with the use of recursive functions to manipulate binary search trees. Once you have a basic understanding of trees, the actual code that you have to write for the lab is quite short. Review the notes from Lectures 16 and 17 prior to starting. Download the files:
http://www.cs.rpi.edu/academics/courses/spring07/cs2/lab09/cs2set.h http://www.cs.rpi.edu/academics/courses/spring07/cs2/lab09/test_cs2set.cpp
Then, turn off all network connections. Examine the code in cs2set.h and testset.cpp. The former contains the implementation discussed in Lectures 16 and 17, including the functions implemented in lecture as exercises. The latter contains code for testing the implementation. Some of this has been commented out because all the functions have not yet been implemented.