Lab 8: Inorder Tree Traversal

Due at the next lab session

For this lab, add a feature to the tree we started in last week's class (class_tree.h and tree_tester.cpp) so that the tree can be converted to a string, with all items in order. This should operate in O(n log(n)) time, not anything worse. One way to do this is to create a recursive function in the manner of the graph creation function. This is a variety of depth-first traversal. Perhaps take a look at the wikipedia page on tree traversal. Essentially, your recursive function will explore the left subtree, then add the current item to the string, then explore the right subtree. The graph creation is a preorder traversal, since it adds the current item, then explores the left subtree, then the right subtree.
Feel free to do this lab in a different way if you like. It's certainly possible with a loop, but is somewhat more complicated.
Name your method anything you like. If you happen to name it "operator string()", then it can be automatically called for lines of code like this:
string output = int_test_tree; // calls the conversion operator
		
Note that it still won't fully support the usual sort of cout statement unless you add an insertion operator. It will enable both implicit and explicit cast to string, so this would work:
		cout << (string)int_test_tree << endl;
		
If you'd rather not deal with operators, feel free to name your method make_string or something like that. For the int_test_tree we made in class, the string representation should look like this:
[1, 3, 5, 9, 100, 105, 110, 115, 120, 150, 180]