GATE Exam  >  GATE Questions  >   Consider a disk with block size B = 512 byte... Start Learning for Free
Consider a disk with block size B = 512 bytes. A block pointer is P = 6 bytes long, and a record pointer is PR =7 bytes long. A file has r = 16384 STUDENT records of fixed-length. Each record has the following fields:
NAME (30 bytes), ROLL(9bytes), DEPARTMENT(9 bytes), ADDRESS(40 bytes),
PHONE (10 bytes), DOB(8 bytes), CLASS(4 bytes),
Two additional bytes are used as markers. Multilevel indexing is used.
If the file is ordered using ROLL value, the number of block accesses needed to search for and retrieve a record from the file is:
  • a)
    3
  • b)
    4
  • c)
    5
  • d)
    6
Correct answer is option 'B'. Can you explain this answer?
Verified Answer
Consider a disk with block size B = 512 bytes. A block pointer is P =...
Record length(R) = 30 + 9 + 9 + 40 + 10 + 8 + 4 + 2 = 112.
Blocking factor(bfr) = floor(B/R) = floor(512/112) = 4.
No. of blocks needed for data = ceil(16384/4) = 4096.
Index record size = P+ = 6+9 = 15
(Since primary indexing, file is ordered using ROLL key, so sparse index, so block pointer is used; not record pointer).
index blocking factor(bfri) = floor(512/15) = 34.
No. of first level index entries = no.of first-level blocks = ceil(4096/34) = 121.
No. of second level index entries = no.of second-level blocks = ceil(121/34) = 3.
No. of third level index entries = no.of third-level blocks = ceil(3/34) = 1.
So no. of levels obtained above for multilevel indexing = 3
So no of block access = no of index block accessed for each level + data block access by block pointer = 3 + 1 = 4.
View all questions of this test
Most Upvoted Answer
Consider a disk with block size B = 512 bytes. A block pointer is P =...
Solution:

Given parameters:
Block size (B) = 512 bytes
Block pointer size (P) = 6 bytes
Record pointer size (PR) = 7 bytes
Number of records (r) = 16384
Record fields:
NAME (30 bytes), ROLL(9bytes), DEPARTMENT(9 bytes), ADDRESS(40 bytes),PHONE (10 bytes), DOB(8 bytes), CLASS(4 bytes), two additional bytes as markers.

To find out the number of block accesses needed to search for and retrieve a record from the file, the following steps can be followed:

Step 1: Calculate the size of each record
The size of each record can be calculated as follows:
Size of each record = sum of the size of all fields + size of additional markers
Size of each record = 30 + 9 + 9 + 40 + 10 + 8 + 4 + 2
Size of each record = 112 bytes

Step 2: Calculate the number of records that can be stored in each block
The number of records that can be stored in each block can be calculated as follows:
Number of records that can be stored in each block = Block size (B) / Size of each record
Number of records that can be stored in each block = 512 / 112
Number of records that can be stored in each block = 4.57 ≈ 4

Step 3: Calculate the number of blocks needed to store all the records
The number of blocks needed to store all the records can be calculated as follows:
Number of blocks needed to store all the records = Total number of records / Number of records that can be stored in each block
Number of blocks needed to store all the records = 16384 / 4
Number of blocks needed to store all the records = 4096

Step 4: Calculate the number of levels in the multilevel indexing
The number of levels in the multilevel indexing can be calculated as follows:
Number of levels = log(Number of blocks needed to store all the records) / log(Number of pointers that can be stored in each block)
Number of levels = log(4096) / log(B / P)
Number of levels = log(4096) / log(512 / 6)
Number of levels = 3.51 ≈ 4

Step 5: Calculate the number of block accesses needed to search for and retrieve a record
The number of block accesses needed to search for and retrieve a record can be calculated as follows:
Number of block accesses = Number of levels + 1
Number of block accesses = 4 + 1
Number of block accesses = 5

Therefore, the number of block accesses needed to search for and retrieve a record from the file is option 'B' i.e. 4.
Explore Courses for GATE exam

Similar GATE Doubts

Consider a disk with block size B = 512 bytes. A block pointer is P = 6 bytes long, and a record pointer is PR =7 bytes long. A file has r = 16384 STUDENT records of fixed-length. Each record has the following fields:NAME (30 bytes), ROLL(9bytes), DEPARTMENT(9 bytes), ADDRESS(40 bytes),PHONE (10 bytes), DOB(8 bytes), CLASS(4 bytes),Two additional bytes are used as markers. Multilevel indexing is used.If the file is ordered using ROLL value, the number of block accesses needed to search for and retrieve a record from the file is:a)3b)4c)5d)6Correct answer is option 'B'. Can you explain this answer?
Question Description
Consider a disk with block size B = 512 bytes. A block pointer is P = 6 bytes long, and a record pointer is PR =7 bytes long. A file has r = 16384 STUDENT records of fixed-length. Each record has the following fields:NAME (30 bytes), ROLL(9bytes), DEPARTMENT(9 bytes), ADDRESS(40 bytes),PHONE (10 bytes), DOB(8 bytes), CLASS(4 bytes),Two additional bytes are used as markers. Multilevel indexing is used.If the file is ordered using ROLL value, the number of block accesses needed to search for and retrieve a record from the file is:a)3b)4c)5d)6Correct answer is option 'B'. Can you explain this answer? for GATE 2024 is part of GATE preparation. The Question and answers have been prepared according to the GATE exam syllabus. Information about Consider a disk with block size B = 512 bytes. A block pointer is P = 6 bytes long, and a record pointer is PR =7 bytes long. A file has r = 16384 STUDENT records of fixed-length. Each record has the following fields:NAME (30 bytes), ROLL(9bytes), DEPARTMENT(9 bytes), ADDRESS(40 bytes),PHONE (10 bytes), DOB(8 bytes), CLASS(4 bytes),Two additional bytes are used as markers. Multilevel indexing is used.If the file is ordered using ROLL value, the number of block accesses needed to search for and retrieve a record from the file is:a)3b)4c)5d)6Correct answer is option 'B'. Can you explain this answer? covers all topics & solutions for GATE 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Consider a disk with block size B = 512 bytes. A block pointer is P = 6 bytes long, and a record pointer is PR =7 bytes long. A file has r = 16384 STUDENT records of fixed-length. Each record has the following fields:NAME (30 bytes), ROLL(9bytes), DEPARTMENT(9 bytes), ADDRESS(40 bytes),PHONE (10 bytes), DOB(8 bytes), CLASS(4 bytes),Two additional bytes are used as markers. Multilevel indexing is used.If the file is ordered using ROLL value, the number of block accesses needed to search for and retrieve a record from the file is:a)3b)4c)5d)6Correct answer is option 'B'. Can you explain this answer?.
Solutions for Consider a disk with block size B = 512 bytes. A block pointer is P = 6 bytes long, and a record pointer is PR =7 bytes long. A file has r = 16384 STUDENT records of fixed-length. Each record has the following fields:NAME (30 bytes), ROLL(9bytes), DEPARTMENT(9 bytes), ADDRESS(40 bytes),PHONE (10 bytes), DOB(8 bytes), CLASS(4 bytes),Two additional bytes are used as markers. Multilevel indexing is used.If the file is ordered using ROLL value, the number of block accesses needed to search for and retrieve a record from the file is:a)3b)4c)5d)6Correct answer is option 'B'. Can you explain this answer? in English & in Hindi are available as part of our courses for GATE. Download more important topics, notes, lectures and mock test series for GATE Exam by signing up for free.
Here you can find the meaning of Consider a disk with block size B = 512 bytes. A block pointer is P = 6 bytes long, and a record pointer is PR =7 bytes long. A file has r = 16384 STUDENT records of fixed-length. Each record has the following fields:NAME (30 bytes), ROLL(9bytes), DEPARTMENT(9 bytes), ADDRESS(40 bytes),PHONE (10 bytes), DOB(8 bytes), CLASS(4 bytes),Two additional bytes are used as markers. Multilevel indexing is used.If the file is ordered using ROLL value, the number of block accesses needed to search for and retrieve a record from the file is:a)3b)4c)5d)6Correct answer is option 'B'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Consider a disk with block size B = 512 bytes. A block pointer is P = 6 bytes long, and a record pointer is PR =7 bytes long. A file has r = 16384 STUDENT records of fixed-length. Each record has the following fields:NAME (30 bytes), ROLL(9bytes), DEPARTMENT(9 bytes), ADDRESS(40 bytes),PHONE (10 bytes), DOB(8 bytes), CLASS(4 bytes),Two additional bytes are used as markers. Multilevel indexing is used.If the file is ordered using ROLL value, the number of block accesses needed to search for and retrieve a record from the file is:a)3b)4c)5d)6Correct answer is option 'B'. Can you explain this answer?, a detailed solution for Consider a disk with block size B = 512 bytes. A block pointer is P = 6 bytes long, and a record pointer is PR =7 bytes long. A file has r = 16384 STUDENT records of fixed-length. Each record has the following fields:NAME (30 bytes), ROLL(9bytes), DEPARTMENT(9 bytes), ADDRESS(40 bytes),PHONE (10 bytes), DOB(8 bytes), CLASS(4 bytes),Two additional bytes are used as markers. Multilevel indexing is used.If the file is ordered using ROLL value, the number of block accesses needed to search for and retrieve a record from the file is:a)3b)4c)5d)6Correct answer is option 'B'. Can you explain this answer? has been provided alongside types of Consider a disk with block size B = 512 bytes. A block pointer is P = 6 bytes long, and a record pointer is PR =7 bytes long. A file has r = 16384 STUDENT records of fixed-length. Each record has the following fields:NAME (30 bytes), ROLL(9bytes), DEPARTMENT(9 bytes), ADDRESS(40 bytes),PHONE (10 bytes), DOB(8 bytes), CLASS(4 bytes),Two additional bytes are used as markers. Multilevel indexing is used.If the file is ordered using ROLL value, the number of block accesses needed to search for and retrieve a record from the file is:a)3b)4c)5d)6Correct answer is option 'B'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Consider a disk with block size B = 512 bytes. A block pointer is P = 6 bytes long, and a record pointer is PR =7 bytes long. A file has r = 16384 STUDENT records of fixed-length. Each record has the following fields:NAME (30 bytes), ROLL(9bytes), DEPARTMENT(9 bytes), ADDRESS(40 bytes),PHONE (10 bytes), DOB(8 bytes), CLASS(4 bytes),Two additional bytes are used as markers. Multilevel indexing is used.If the file is ordered using ROLL value, the number of block accesses needed to search for and retrieve a record from the file is:a)3b)4c)5d)6Correct answer is option 'B'. Can you explain this answer? tests, examples and also practice GATE tests.
Explore Courses for GATE exam
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev