Expression trees are a way to represent mathematical expressions using a hierarchical tree structure. Each node in the tree can be an operand (such as a number or a variable) or an operator (such as addition or multiplication)
expression tree for the expression “A + (B * C)”:
+
/ \
A *
/ \
B C
Expression trees are useful in computer science and mathematics for representing and manipulating mathematical expressions. They allow you to see the structure of the expression, making it easier to evaluate or simplify expressions, especially in symbolic mathematics and computer algebra systems
why we use postfix or prefix expression in computers ?
to resolve ambiguity: In infix notation, expressions like “a – b * c” can be ambiguous without parentheses to clarify the order of operations and results to multiple structure for same infix expression, whereas in prefix or postfix notation, there is no ambiguity and each such expressions also result to a unique structure. Therefore, computers often convert infix expressions into prefix or postfix (reverse Polish notation) for internal processing and evaluation. This conversion process is known as parsing or expression parsing.
Moreover, Prefix or postfix notation can be more compact than infix notation for certain expressions, especially those with long chains of operators. This compactness can be beneficial when storing or transmitting mathematical expressions
Watch following videos for better understanding and operations