CS2 Course Summary Slide 27
Two application programming problems are posed in the context of the binary tree package. Students are asked to:
- Write a MonthTest application program which creates a StringBinaryTree object containing the names of the months. Add the months chronologically (i.e., January, February, ...) in such a way that the names will be displayed alphabetically when an inorder traversal is performed on it. Perform the three traversals on the tree and compute its height.
- Write an ExpressionTest application program which creates an ObjectBinaryTree object containing the following expression: ( ( ( 11 + 5 ) / ( 7 * 6 ) ) - ( 33 - ( 9 * 16 ) ) ). Perform the three traversals on the tree and compute its height.