COS 226 PROBLEM SET 5

1. Draw the digital search tree that results when you insert the keys 00100 00001 10110 11100 11101 in that order into an initially empty tree.







2. Draw the binary trie that results when you insert the keys 00100 00001 10110 11100 11101 into an initially empty trie.







3. Draw the Patricia trie that results when you insert the keys 00100 00001 10110 11100 11101 in that order into an initially empty trie.






4. [Exercise 14.47, revised] For 10 million integer keys, compute the hash table size that makes each of the three hashing methods (separate chaining, linear probing, and double hashing) use the same number of key comparisons as BSTs for a search miss, on the average, counting the hash function computation as a comparison.




5. [Exercise 14.48, revised] For 10 million integer keys, compute the number of comparisons for each of the three hashing methods (separate chaining, linear probing, and double hashing) for a search miss, on the average, when they can use a total of 30 million words of memory (as BSTs would).




Due: in precept on March 8 or 9.

Do your work on this page (use the back if you must)