midsol - University of Waterloo Midterm Examination...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: University of Waterloo Midterm Examination Solution Winter, 2011 1. (6 total marks) The diagram below shows an extensible hash table with four hash buckets. Each number x in the buckets represents an entry for a record for which the hashed key value is x . For example, the number 20 in the rst hash bucket represents a record for which the hashed key value is 20. The maximum number of records per bucket is four. directory 00 01 10 11 20,4,16 5,25,21,13 hash table 27,15,19 a. (2 marks) Give a sequence of two insertions that will cause exactly one new hash bucket to be added without changing the size of the directory. An example of an insertion is insert 9 , which refers to insertion of a tuple with a hashed key value of 9 . The two hashed key values in your sequence should be distinct, and should be distinct from the values already shown in the hash table. Both insertions should be into the bucket pointed to by directory entries 00 and 10, and at least one should have hash value 10. For example: insert 8 insert 10 b. (2 marks) Give a sequence of two insertions that will not cause the hash tables directory to grow and that will not cause any new hash buckets to be added. Start from the original hash table shown in the gure above, not from the hash table that would result from the inserts from part (a). The two hashed key values in your sequence should be distinct, and should be distinct from the values already shown in the hash table. One insertion must go to bucket 00 (or 10), and the other insertion must go to bucket 11. For example insert 8 insert 11 c. (2 marks) Give a sequence of two insertions that will cause the hash tables directory to double twice. If this is not possible, write NOT POSSIBLE . Start from the original hash table shown in the gure above. The two hashed key values in your sequence should be distinct, and should be distinct from the values already shown in the hash table. To cause the directory to double twice, both insertions must go into what will become bucket 101 after the directory doubles for the rst time. In other words x mod 8 must equal 5. For example: insert 29 insert 37 CS448/648 1 of 6 2. (6 total marks) Suppose that a B+Tree index has been created for some attribute R.x of a relation R . a. (1 mark) Assume that the B+Tree is clustered and of Type I (index leaves contain tuples of R ). Consier the two rightmost leaf blocks of the B+Tree. Is it necessarily true that the these two blocks are sequential in the le or disk that contains the B+Tree? Answer YES or NO ....
View Full Document

This note was uploaded on 03/20/2011 for the course CS 448 taught by Professor Ihabilyas during the Winter '10 term at Waterloo.

Page1 / 6

midsol - University of Waterloo Midterm Examination...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online