


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



Closed books. Closed notes. Calculators OK. 105 points. 75 minutes. Weight of each question in parentheses. Please use a pencil. For more space, use the back of the sheet. For scratch paper, ask the proctor Hao Jiang.
1. (5) Insert the values in set A into an initially empty skew min heap. Show only the final tree. (5) Then insert the values in set B into an initially empty skew min heap. Show only the final tree. A: 13 44 62 98 43 16 24 B: 29 84 67 19 15 44 11 (5) Finally, merge heap A with heap B. Show only the final tree. 2. (10) Insert the following into a B-Tree with M=3 and L=4. Ignore duplicates. Show only the final tree. 61 27 19 5 7 25 36 4 27 42 2 13 44 62 98 43 16 24 29 15
3. (10) Assume that a disk block (sector) can hold 64K bytes. Assume that a record key is 128 bytes long and that a disk reference requires 8 bytes. What is the maximum size that M can take, where M is the number of children and (M–1) is the number of keys contained in an interior node of a B-Tree. Show clearly how you arrived at your answer. 4. (10) Assume that a disk block can hold 64K bytes. Assume that a record, including the key, is 2K bytes long. What is the maximum size that L can take, where L is the number of records contained in a leaf node of a B- Tree. Show clearly how you arrived at your answer. 5. (10) Perform the following operations on an initially empty Leftist max Heap. Repeat: max Heap_. Show only_ the final heap. Note that “D” means “delete”. 57 23 26 34 D 16 24 29 19 5 7 D 15 61 27 D 4 6. (10) Perform the following operations on an initially empty binomial min-queue. Repeat: min-queue. Show only the final queue. Note that “D” means “delete”. 57 23 26 34 D 16 24 29 19 5 7 D 15 61 27 D 4
d) (Fill in the blank) You should consider rehashing when the hash table _____________________________. e) ______ What is the max number of records that can be stored in a B-Tree with M=4, L=5, and height h=5.