next up previous


CSE 2320 Section 501/571 Fall 1999

Homework 3

Due: October 26, 1999, in class (October 27, 1999, 5:00pm for -10%)

1.
Show the hash table H after inserting the keys 30, 79, 8, 39, 11, 60, 16, 14, 19, 17, 44, 18 (in this order). H has m=13 slots and uses collision resolution by open addressing and the double hashing function $h(k,i) = (h_1(k) + ih_2(k)) \bmod m$, where $h_1(k) = k \bmod m$ and $h_2(k) = 1 + (k \bmod m^{\prime})$, $m^{\prime} = m-2$. Show all computations of hash table indices, including collisions.

2.
Show the binary-search tree whose post-order traversal is 1, 3, 5, 4, 2, 6, 9, 11, 13, 12, 10, 8, 7. Also, show the preorder traversal of your tree.

3.
Show the Red-Black trees that result after each successive insertion of the keys 30, 79, 8, 39, 11, 60, 16, 14, 19, 17 (in this order) into an initially empty Red-Black tree.

4.
Show the Red-Black trees that result after each successive deletion of the keys 13, 40, 95, 42, 70, 27, 5, 26, 49, 69 (in this order) from the following Red-Black tree.


\psfig{figure=figures/h34.ps}

5.
Show the B-trees that result after each successive insertion of the keys X, F, A, Y, T, H, I, G, Q, W, U, S, R, J, D, E, B, Z, C, V (in this order) into an initially empty B-tree with minimum degree t = 3.

6.
Show the B-trees that result after each successive deletion of the keys J, O, H, X, T, R, S, F, C, K, P, G, E, L, I (in this order) from the following B-tree with minimum degree t = 2. When you have a choice between a left or right sibling, always choose the left sibling. Always try Case 2a (predecessor) before Case 2b (successor).


\psfig{figure=figures/h36.ps}


next up previous