Data Structures and Algorithms
with Object-Oriented Design Patterns in C# |
The algebraic expression in Equation is written in the usual way such mathematical expressions are written. The notation used is called infix notation because each operator appears in between its operands. As we have seen, there is a natural relationship between infix notation and inorder traversal.
Infix notation is only possible for binary operations such as addition, subtraction, multiplication, and division. Writing an operator in between its operands is possible only when it has exactly two operands. In Chapter we saw two alternative notations for algebraic expressions--prefix and postfix.