Lecture 13
Learning objectives
After this class, you should be able to:
- Define a binary tree and a complete binary tree.
- Show how the vertices of a binary tree can be represented in C++.
- Show how a complete binary tree can be represented using an array.
- Derive the relationship between the number of vertices and the height of a binary tree.
- Given a binary tree, give the order in which vertices of the tree are visited by an inorder traversal.
Reading assignment
- Section 4.2.
- Lecture: Trees: Part 2 -- Binary trees.
- Page 124.
Exercises and review questions
- Exercises and review questions on current lecture's material
- Prove the formulas that we showed for the positions of the parent and children of vertices in the array representation of a complete binary tree.
- Give the order in which vertices of the tree in figure 4.73 are visited by an inorder traversal.
- Questions on next lecture's material
- Give an example of a binary tree that is not a binary search tree.
Last modified: 27 Sep 2011