Binary Tree Expression Exercises
Binary Tree Expression Exercises
A binary expression tree is a specific king of a binary tree used to represent expressions. Two common
types of expressions that a binary expression tree can represent are algebraic and Boolean. These trees can
represent expressions that contain both unary and binary operators.
Like any binary tree, each node of a binary expression tree has zero, one, or two children. This restricted
structure simplifies the processing of expression trees.
Expression Tree
The expression tree is a binary tree in which each internal node corresponds to the operator and each leaf
node corresponds to the operand so for example expression tree for 3 + ((5+9)*2) would be:
Inorder traversal of expression tree produces infix version of given postfix expression (same with
postorder traversal it gives postfix expression)
1.) 2.)
3.) 4.)
5.) 6.)
7.)
8.)
9.)
10.)