Implementing the expression as a binary tree


Question 1) Implement the expression true as a binary tree, which does the following:

a) Build the expression tree from a given String containing a fully-parenthesized arithmetic expression, for example "(((3.2 * 25) - (4.3 / 2)) + 9.3)", where each operand is the positive real number, integer, or the expression, and an operator is +, -, *, or /, with two operands and a pair of parentheses indicating the order of operations.

b) Build the expression tree from either given (double or int) number alone, or a given (char) operator plus two sub-trees.

c) Evaluate the given expression tree.

d) Convert a given expression tree into a String, according to given traversal order (preorder, inorder, or postorder).

Write full java source.

Request for Solution File

Ask an Expert for Answer!!
Data Structure & Algorithms: Implementing the expression as a binary tree
Reference No:- TGS04563

Expected delivery within 24 Hours