0% found this document useful (0 votes)
76 views

Binary Tree Expression Exercises

Uploaded by

Tet - Sama
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views

Binary Tree Expression Exercises

Uploaded by

Tet - Sama
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Binary Tree Expression

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)

Exercises Nos. 1 to 10 (100 POINTS)


Requirements: Traverse the given Binary Tree using IN ORDER, PRE ORDER, and POST
ORDER of traversal. Show your solution.

1.) 2.)

3.) 4.)
5.) 6.)

7.)

8.)
9.)

10.)

You might also like