Due: Tuesday, February 14th, 2012 9:10am
Start with avl.c from bst.zip.
Change the integer tree to a string tree, change the tests to use strings, and change the loop in main to work with string lines instead of integers from lines.
As a reminder, you’ll need to #include <string.h> and use the following C library functions:
Add (and test) get_max and get_min functions on non-empty trees that return a tree’s smallest and largest values, respectively.
Change main so that it prints the smallest and largest values in its tree (if the tree is not empty) before exiting.
For example, if you run the program with - as the command-line argument and then type apple, coconut, and banana followed by Ctl-D, then the program should print apple and coconut.
Last update: Thursday, February 9th, 2012mflatt@cs.utah.edu |