Expression Trees, Tree Traversals
12 flashcards · Computer Science · by Sureshkumar Ramanujam
Expression tree is a binary tree
max no of nodes
Draw the expression tree for the following expression a b + c *
How the expression tree looks like for the given expression (5-x)*y+6/(x + z)
Find the postfix expression for the given tree
2, 6, *, 3, 8, /, +
Which is the correct representation of the given expression 3+4*2 Either the left tree or right tree
Right, because the '*' operator has the highest precedence over the '+'
What is the postorder traversal of the given expression tree?
Left-Right-Root 8 5 - 4 2 + 3 / *
Find the corresponding expression for the given tree
a – b / c + d * e ^ f ^ g
In Inorder traversal we will visit the root at middle?
Find the postorder traversal for the given tree
Traverse the given tree using preorder traversal
Draw the corresponding tree, when given
Given the preorder and inorder traversals, check the corresponding tree is right or not Preorder: 0,1,3,6,2,4,7,9,8,5 Inorder: 3,6,1,0,9,7,4,8,2,5
Correct