Assume one file has r =106 records. Each record takes R = 100 bytes, of which 10
ID: 666315 • Letter: A
Question
Assume one file has r =106 records. Each record takes R = 100 bytes, of which 10 bytes are for the key of the record. Suppose the key values range from 1 through 1,000,000, inclusive. Assume the block size B is 1000 bytes for all files, and that an address (block pointer, tree node pointer, or data record pointer) takes 10 bytes.
Sequential file
A. What is the blocking factor bfr for the file?
B. How many data blocks b are needed to hold records?
C. How many data blocks accesses on the average are needed to fetch a record by using linear search?
D. How many data blocks accesses are needed to fetch a record by using binary search?
Explanation / Answer
given file has r = 106
R = 100 bytes
Block size B = 1000
A)
Blocking factor = block size / record size = 1000/100 = 10 records in a block.
B)
Number of blocks required are = r/bfr = 106/10 = 10.6 ~~11
C)
For Linear search the blocks required are n blocks...so r blocks = 106 blocks
d) For binary search the data blocks required are log2 r = log2 106 ==> 6.727920454563199 ~~ 7 block accesses.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.