|
|
|
|
CSE373 Data Structures Au07, Homework 3 - Part 1
Due at the begining of the Monday's class, October 29th.
Please submit the electronic copy of your assignment
here
and bring the hardcopy to the class.
No late assignments will be accepted.
Here are some questions on trees. You only need to turn in written solutions.
Problems
- Binary search trees
- Draw a picture of the integer-valued BST that
results when these values are inserted in this order: 7, 16, 11,
3, 6, 8, 17, 45, 12.
- Which nodes are the leaves of this tree? Which node is the root?
- What is the depth of the node containing 3? What is the
height of the node containing 7?
- Write down the order in which the node values are reached by (i) a preorder,
(ii) an inorder, and (iii) a postorder traversal of the tree.
- Draw the sequence of trees that result if we perform these operations successively on
the original tree from part (a):
add(9) , delete(17) , add(13) , delete(7) .
- Weiss, 4.19.
- Weiss, 4.27.
- Weiss, 4.28.
|