case studyan expression tree in example we introduced the use of binary tree to represent the structure of an arithmetic expression in this sectionwe define new expressiontree class that provides support for constructing such treesand for displaying and evaluating the arithmetic expression that such tree represents our expressiontree class is defined as subclass of linkedbinarytreeand we rely on the nonpublic mutators to construct such trees each internal node must store string that defines binary operator ( )and each leaf must store numeric value (or string representing numeric valueour eventual goal is to build arbitrarily complex expression trees for compound arithmetic expressions such as ((( )/(( )howeverit suffices for the expressiontree class to support two basic forms of initializationexpressiontree(value)create tree storing the given value at the root expressiontree(ope )create tree storing string op at the root ( +)and with the structures of existing expressiontree instances and as the left and right subtrees of the rootrespectively such constructor for the expressiontree class is given in code fragment the class formally inherits from linkedbinarytreeso it has access to all the nonpublic update methods that were defined in section we use add root to create an initial root of the tree storing the token provided as the first parameter then we perform run-time checking of the parameters to determine whether the caller invoked the one-parameter version of the constructor (in which casewe are done)or the three-parameter form in that casewe use the inherited attach method to incorporate the structure of the existing trees as subtrees of the root composing parenthesized string representation string representation of an existing expression tree instancefor exampleas ((( + ) )/(( - )+ )can be produced by displaying tree elements using an inorder traversalbut with opening and closing parentheses inserted with preorder and postorder steprespectively in the context of an expressiontree classwe support special str method (see section that returns the appropriate string because it is more efficient to first build sequence of individual strings to be joined together (see discussion of "composing stringsin section )the implementation of str relies on nonpublicrecursive method named parenthesize recur that appends series of strings to list these methods are included in code