Expression Trees, Tree Traversals

12 flashcards · Computer Science · by Sureshkumar Ramanujam

  1. Expression tree is a binary tree

    max no of nodes

  2. Draw the expression tree for the following expression a b + c *

  3. How the expression tree looks like for the given expression (5-x)*y+6/(x + z)

  4. Find the postfix expression for the given tree

    2, 6, *, 3, 8, /, +

  5. 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 '+'

  6. What is the postorder traversal of the given expression tree?

    Left-Right-Root 8 5 - 4 2 + 3 / *

  7. Find the corresponding expression for the given tree

    a – b / c + d * e ^ f ^ g

  8. In Inorder traversal we will visit the root at middle?

  9. Find the postorder traversal for the given tree

  10. Traverse the given tree using preorder traversal

  11. Draw the corresponding tree, when given

  12. 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