Check that the expression is well formed that means the


Write program that takes as input an arithmetic expression and should do the following:

1. Check that the expression is well formed: that means the number of opening parenthesis '(' is equal to closing ones, the operands are numeric characters, the operators are +, -, * or /.

2. Build the expression tree based on the arithmetic expression. This will take into consideration the priority of some operators over the others. Each node in the tree has as value a number or a string. In particular, leaf nodes have number values while intermediary nodes have a string value.

3. Evaluate the outcome of the whole expression by traversing the tree (using one variant of depth-first search) starting with leaf nodes and evaluating each branch until you get the result.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Check that the expression is well formed that means the
Reference No:- TGS02755964

Now Priced at $15 (50% Discount)

Recommended (92%)

Rated (4.4/5)