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

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

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.
Image of page 8

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

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
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.
Image of page 10

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

Image of page 11
This is the end of the preview. Sign up to access the rest of the document.
  • Spring '13
  • Dr.Khansari
  • hash function, Prime number, Bucket address table

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern