Review Questions
No solutions will be posted.
We will solve a subset of the following problems in the lecture on December 8
.
NOTE: As you may have noticed, we used a lot of examples and diagrams in the lectures. So email is not an
effective method to answer questions related to course material. Please DO NOT ask how to solve the
following problems via EMAIL. Attend the lecture on December 8 and come to the office hours.
Exercises from Textbook
Trees
: C7.3, C7.4, C7.21, C7.24, C7.31.
Note: Solve C7.4 first then C7.31. You may assume binary trees for these 2 problems to simplify the code.
BSTs, AVL Trees
: R10.1, R10.4, R10.7, R10.9, R10.10, R10.11, C10.1.
Heaps
: C8.14, C8.17.
Hash Tables
: R9.5, R9.6, R9.7, R9.8, R9.12.
Graphs
: R13.2, R13.8, R13.9, R13.10.
More Exercises
1.
Given the keys 1, 2, ..., 14, and 15, show a sequence of insertions that results in
a.
a nicely balanced binary search tree.
b.
a very unbalanced BST.
2.
Given the hash function
h(x) = x % 10
, insert the items:
{4371, 1323, 6173, 4199,
4344, 9679, 1989}
and show the resulting hash table for each of the following collision
resolution policies:
a.
Separate (i.e. external) Chaining.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '09
 neugyen
 Quadratic probing, largest element, binary search tree.

Click to edit the document details