Data Structures and Algorithms

Homework 06

Question 1.
Draw a tree that represents the expression (3*45 + 10*(6-2))-(5/6 + 7*2).

Question 2.
Given Question 1's result tree, list all the internal nodes, leaf nodes. What are the height and the size of the tree?

Question 3.
Given Question 1's result tree, list all nodes in the order visited using preorder/postorder/inorder traversal.

Question 4.
Draw a (single) binary tree T, such that: Each internal node of T stores a single character; A preorder traversal of T yields LISMPNTEO; An inorder traversal of T yields SIMPLETON.