Try It Now
Work these exercises to see how well you understand this material.
- Draw the expression trees for the following expressions:
- a(b + c)
- ab + c
- ab + ac
- bb − 4ac
- ((a3x + a2)x + a1)x + a0
- Write out the preorder, inorder, and postorder traversals of the trees in Exercise 1 above.
- Draw a binary tree with seven vertices and only one leaf.
- Draw a binary tree with seven vertices and as many leaves as possible.
- Prove that if T is a full binary tree, then the number of leaves of T is one more than the number of internal vertices (non-leaves).
Source: Al Doerr and Ken Levasseur, http://faculty.uml.edu/klevasseur/ads-latex/ads.pdf
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License.