{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

1 bits same as that of bucket j while the bit i j is

Info iconThis preview shows pages 8–11. Sign up to view the full content.

View Full Document Right Arrow Icon
1) bits same as that of bucket j while the bit i j is reversed; i k = bits used in bucket k ; if ( i j negationslash= i k ) return ; /* buckets cannot be merged */ if (entries in j + entries in k > bsize ) return ; /* buckets cannot be merged */ move entries of bucket k into bucket j ; decrease the value of i j by 1; make all the bucket-address-table entries, which pointed to bucket k , point to j ; coalesce (bucket j ); end Figure 11.2 Pseudocode for deletion common hash prefix. The array has to be updated in a similar fashion. The bucket address table can be reduced if the i th entry of the array is 0, where i is the number of bits the table is using. Since bucket table reduction is an expensive operation, it is not always advisable to reduce the table. It should be reduced only when sufficient number of entries at the end of count array become 0. 11.11 Answer: We reproduce the instructor relation below.
Background image of page 8

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

View Full Document Right Arrow Icon
Exercises 9 ID name dept name salary 10101 Srinivasan Comp. Sci. 65000 12121 Wu Finance 90000 15151 Mozart Music 40000 22222 Einstein Physics 95000 32343 El Said History 60000 33456 Gold Physics 87000 45565 Katz Comp. Sci. 75000 58583 Califieri History 62000 76543 Singh Finance 80000 76766 Crick Biology 72000 83821 Brandt Comp. Sci. 92000 98345 Kim Elec. Eng. 80000 a. Bitmap for salary , with S 1 , S 2 , S 3 and S 4 representing the given inter- vals in the same order S 1 0 0 1 0 0 0 0 0 0 0 0 0 S 2 0 0 0 0 0 0 0 0 0 0 0 0 S 3 1 0 0 0 1 0 0 1 0 0 0 0 S 4 0 1 0 1 0 1 1 0 1 1 1 1 b. The question is a bit trivial if there is no bitmap on the dept name attribute. The bitmap for the dept name attribute is: Comp. Sci 1 0 0 0 0 0 1 0 0 0 1 0 Finance 0 1 0 0 0 0 0 0 1 0 0 0 Music 0 0 1 0 0 0 0 0 0 0 0 0 Physics 0 0 0 1 0 1 0 0 0 0 0 0 History 0 0 0 0 1 0 0 1 0 0 0 0 Biology 0 0 0 0 0 0 0 0 0 1 0 0 Elec. Eng. 0 0 0 0 0 0 0 0 0 0 0 1 To find all instructors in the Finance department with salary of 80000 or more, we first find the intersection of the Finance department bitmap and S 4 bitmap of salary and then scan on these records for salary of 80000 or more. Intersection of Finance department bitmap and S 4 bitmap of salary . S 4 0 1 0 1 0 1 1 0 1 1 1 1 Finance 0 1 0 0 0 0 0 0 1 0 0 0 S 4 Finance 0 1 0 0 0 0 0 0 1 0 0 0
Background image of page 9
10 Chapter 11 Indexing and Hashing Scan on these records with salary 80000 or more gives Wu and Singh as the instructors who satisfy the given query. 11.12 Answer: If the index entries are inserted in ascending order, the new entries get directed to the last leaf node. When this leaf node gets filled, it is split into two. Of the two nodes generated by the split, the left node is left untouched and the insertions takes place on the right node. This makes the occupancy of the leaf nodes to about 50 percent, except the last leaf. If keys that are inserted are sorted in descending order, the above situation would still occur, but symmetrically, with the right node of a split never getting touched again, and occupancy would again be 50 percent for all nodes other than the first leaf. 11.13 Answer: a. The cost to locate the page number of the required leaf page for an insertion is negligible since the non-leaf nodes are in memory.
Background image of page 10

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

View Full Document Right Arrow Icon
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}