CPSC 220 Fall 2003
Homework 1: Binary Trees
- Draw a binary tree whose preorder traversal is A B C D E F G H I.
- Draw a binary tree whose inorder traversal is A B C D E F G H I.
- Draw a binary tree whose postorder traversal is A B C D E F G H I.
- Draw a binary tree whose levelorder traversal is A B C D E F G H I.
For questions 5-8, give both an exact answer (e.g, (x2-1)/2) and an
answer in big-O (e.g., O(x2)).
- What is the maximum number of nodes in a binary tree of height h?
- What is the minimum number of nodes in
- a binary tree of height h?
- a complete binary tree of height h?
- What is the maximum height of a binary tree with n nodes?
- What is the minimum height of a binary tree with n nodes?