{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Assignment4a - Pages 505-9 Exercises 13.23 Consider a disk...

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

View Full Document Right Arrow Icon
Pages 505-9: Exercises 13.23 Consider a disk with the following characteristics (these are not parameters of any particular disk unit): block size B=512 bytes, interblock gap size G=128 bytes, number of blocks per track=20, number of tracks per surface=400. A disk pack consists of 15 double-sided disks. a. Total track capacity = 20 * (512+128) = 12.8 Kbytes Useful track capacity = 20 * 512 = 10.24 Kbytes b. 400 Cylinders c. Total cylinder capacity = 15*2*20*(512+128) = 384 Kbytes Useful cylinder capacity = 15 * 2 * 20 * 512 = 307.2 Kbytes d. Total disk pack capacity = 15 * 2 * 400 * 20 * (512+128)= 153.6 Mbytes. Useful disk pack capacity = 15 * 2 * 400 * 20 * 512 = 122.88 Mbytes e. Transfer rate = (total track size in bytes)/(single disk revolution msec) tr= (12800) / (25) = 512 bytes/msec block transfer time = B / tr = 512 / 512 = 1 msec average rotational delay rd = (1/ 2)*(1/p) min = 12.5 msec bulk transfer rate btr= ( B/(B+G) )*tr = (512/640)*512 = 409.6 bytes/msec f. average time to locate and transfer a single block = s+rd+btt = 30+12.5+1 = 43.5 msec g. time to transfer 20 random blocks = 20 * (s + rd + btt) = 20 * 43.5 = 870 msec time to transfer 20 consecutive blocks with double buffering = s + rd + 20*btt = 30 + 12.5 + (20*1) = 62.5 msec Pages 505-9: Exercises 13.28 Load the records of Exercise 13.27 into expandable hash files based on extendible hashing. Show the structure of the directory at each step. Show the directory at each step, and the global and local depths. Use the has function h(k) = K mod 32 K h(K)(bucket number) binary h(K) record1 2369 0 00000 record2 3760 16 10000 record3 4692 20 10100
Background image of page 1

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

View Full Document Right Arrow Icon
record4 4871 7 00111 record5 5659 27 11011 record6 1821 29 11101 record7 1074 18 10010 record8 7115 11 01011 record9 1620 20 10100 record10 2428 28 11100 record11 3943 7 00111 record12 4750 14 01110 record13 6975 31 11111
Background image of page 2
record14 4981 21 10101 record15 9208 24 11000 See Excel spreadsheet at bottom for directory steps. Pages 505-9: Exercises 13.31 Suppose that we have an unordered file of fixed-length records that uses an unspanned record organization. Outline algorithms for insertion, deletion, and modification of a file record. State any assumptions you make. Insert 1. Open the file and set the file pointer position 2. Go to the end of file 3. Insert the record at this current position 4. Save and close the file Delets 1. Open the file and set the file pointer position 2. Find the record where the file pointer = n 3. Delete the record 4. Save and close the file
Background image of page 3

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

View Full Document Right Arrow Icon
Modify 1. Open the file and set the file pointer position 2. Find the record where the file pointer = n 3. Set the file pointer record = ‘modification’ 4. Save and close the file Pages 505-9: Exercises 13.37 (13.35) Write program code to access individual fields of records under each of the following circumstances. For each case, state the assumptions you make concerning pointers, separator characters, and so on. Determine the type of information needed in the file header in order for your code to be general in each case. Pages 545-7: Exercises 14.14 Consider a disk with block size B=512 bytes. A block pointer is P=6 bytes long, and a record pointer is P R =7 bytes long. A file has r=30,000 EMPLOYEE records of fixed-length. Each record has the following fields: NAME (30 bytes), SSN (9 bytes), DEPARTMENTCODE (9 bytes), ADDRESS (40 bytes), PHONE (9 bytes), BIRTHDATE (8 bytes), SEX (1 byte), JOBCODE (4 bytes), SALARY (4 bytes, real number). An additional byte is used as a deletion
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}