Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

COMP 4380 Sample Midterm 1

1.   Define the following terms in your own words:

a.   Primary Storage

b.   Hash Index

c.    Search Key

2.   Assuming the worst-case scenario for all approximations of time, how big (in KB) would a block have to be before transfer time became the majority factor in I/O cost?

3.   Explain in your own words why a sparse, non-clustered index is possible in concept, but useless in practice.

4.   You have a file which contains 10,000 records and three columns: A, B, C (A is the primary key; no other        attributes are unique). Assume that any given page can hold 28 records and the file is sorted on its primary key.

a.   What is the average I/O cost of inserting a new record into this file?

b.   What is the I/O cost of searching for a record with a specific value of A?

c.   What is the I/O cost of searching for a record with a specific value of B?

5.   Consider the following ISAM tree

 

-     Draw the resulting tree after performing the following operations:

o Insert 17*, 19*, 21*, 22*, 25*, 26*, 52*

o Delete 20*, 21*, 22*

o Insert 23*, 24*

6.   Consider the following B+ tree

 

-     Draw the resulting tree after performing the following operations:

o Delete 29*, 20*

o Insert 17*, 21*, 25*, 26*, 52*

o Delete 20*, 22*

o Insert 23*, 9*, 11*, 12*

7.   Consider an initially empty extendible hashing index with a bucket capacity of 2

a.   Draw the index after inserting the following values in order: 2*, 4*, 8*, 16*, 24*, 32*, 64*, 100*, 128*

b.   Draw the index after deleting the following values in order: 2*, 64*

8.   Consider a linear hashing index with a bucket capacity of 2. Assume the index initially contains the values 0* and 1*, Level = 0, and N0  = 2

a.   Draw the index after inserting the following values in order: 2*, 4*, 8*, 16*, 24*, 32*, 64*, 100*, 128*

b.   Draw the index after deleting the following values in order: 2*, 64*