This project is from COP3502, Computer Science 1
A forest, or a tree of trees, maintains records of specific types of "small monsters": animals, birds, fish, and fruits. Given the input file "cop3502-as4-input.txt", the forest will be built first and then a list of commands following its construction will execute. An output file containing the results will be created in a textfile called "cop3502-as4-output-grimes-katelyn.txt".
*NOTE: The first line inside the input file is formatted as %d %d %d. The first integer represents the number of "small monster" types, or trees. The second integer represents the total number of items being added to the forest. Finally, the third integer represents the number of commands to be executed.
search<tree><item>= searches for an item in a specific treeitem_before<tree><item>= counts the number of items before item in a specific treeheight_balance<tree>= prints out the heights of a tree's left and right subtrees, their difference, and whether or not the tree is balanced (a tree is balanced if the height of its left and right subtrees differ >= 1)count<tree>= prints the total number of items in a specific treedelete<tree><item>= deletes an item in a specific treedelete_tree<tree>= deletes a tree
gcc cop3502-as4-grimes-katelyn.c -o out //compile
./out cop3502-as4-input.txt //run
In the terminal, the forest after it is constructed will be printed to the screen along with the updated forest after the list of commands are executed from the input file.
The output file will be called "cop3502-as4-output-grimes-katelyn.txt" and will print a smaller version of the forest and the results of the list of commands from the input file.