Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Consider two files systems A and B , that use... Start Learning for Free
Consider two files systems A and B , that use contiguous allocation and linked allocation, respectively. A file of size 100 blocks is already stored in A and also in B. Now, consider inserting a new block in the middle of the file (between 50th and 51st block), whose data is already available in the memory. Assume that there are enough free blocks at the end of the file and that the file control blocks are already in memory. Let the number of disk accesses required to insert a block in the middle of the file in A and B are nA and nB respectively, then the value of nA + nB is_________.
    Correct answer is '153'. Can you explain this answer?
    Most Upvoted Answer
    Consider two files systems A and B , that use contiguous allocation an...
    Contiguous allocation:
    Contiguous allocation occurs when the blocks are allocated to the file in such a way that all of the file's logical blocks are assigned to the same physical block on the memory.
    For contiguous allocation,
    we have 100 blocks, in contiguous allocation first, we push the 100th block to 101 th block (we need two access), then we push the 99 th block to the 100 th block (we need two access again) and so on up to 51 th block. Now, 51 block is empty, then we push new block to 51 position list need one access).
    So, Total access are= 50 read operations+ 50 write operations+1 operation to write the newly inserted block.
    Total access are=101 operations (nA)
    Linked allocation:
    In this scheme, each file is a linked list of disc blocks that do not have to be contiguous. Disk blocks can be placed anywhere on the disc. The directory entry includes a reference to the beginning and end of the file block. Each block carries a reference to the next block occupied by the file.
    For linked allocation,
    we need to access the block from 1 to 50, new block access that should insert between 50 and 51 blocks, and access 51 blocks. So, the total access is 52.
    Total access are= 50 read operations+ 1 operation delete next pointer of 50 th element +1 operation to connect it to the 51 th element.
    Total access are=52 operations (nB)
    Total operations are required= nA+ nB
    Total operations are required= 101+52
    Total operations are required= 153.
    Hence the correct answer is 153.
    Free Test
    Community Answer
    Consider two files systems A and B , that use contiguous allocation an...
    Contiguous Allocation (File System A)

    In a contiguous allocation file system, files are stored as continuous blocks of data on the disk. Each file has a file control block (FCB) that contains information about the file, such as its size and starting block number.

    Linked Allocation (File System B)

    In a linked allocation file system, files are stored as a linked list of blocks on the disk. Each block contains a pointer to the next block in the file. The FCB of a file contains a pointer to the first block of the file.

    Inserting a Block in the Middle of the File

    In both file systems A and B, the file control blocks are already in memory, so we don't need to access the disk to retrieve them. We also assume that there are enough free blocks at the end of the file to accommodate the new block.

    Contiguous Allocation (File System A)
    To insert a block in the middle of a file in system A, we need to shift all the blocks after the insertion point by one position to make room for the new block. This requires accessing each block individually and moving its contents to the next block.

    The number of disk accesses required to insert a block in the middle of the file in system A can be calculated as follows:
    - To shift the blocks after the insertion point, we need to access each block individually. Since the file size is 100 blocks and we are inserting in the middle, we need to shift 50 blocks.
    - Each block access requires one disk access.
    - Therefore, the number of disk accesses required in system A (nA) is 50.

    Linked Allocation (File System B)
    To insert a block in the middle of a file in system B, we don't need to shift any blocks. We simply need to update the pointers of the blocks before and after the insertion point to include the new block.

    The number of disk accesses required to insert a block in the middle of the file in system B can be calculated as follows:
    - To update the pointers of the blocks before and after the insertion point, we need to access each block individually. Since the file size is 100 blocks and we are inserting in the middle, we need to access 51 blocks (50 blocks before the insertion point and 1 block after).
    - Each block access requires one disk access.
    - Therefore, the number of disk accesses required in system B (nB) is 51.

    Calculating nA - nB
    To calculate nA - nB, we subtract the number of disk accesses in system B from the number of disk accesses in system A:
    nA - nB = 50 - 51 = -1

    However, the correct answer is given as 153. It seems there might be an error or misunderstanding in the question or the given answer.
    Explore Courses for Computer Science Engineering (CSE) exam

    Similar Computer Science Engineering (CSE) Doubts

    Top Courses for Computer Science Engineering (CSE)

    Consider two files systems A and B , that use contiguous allocation and linked allocation, respectively. A file of size 100 blocks is already stored in A and also in B. Now, consider inserting a new block in the middle of the file (between 50th and 51st block), whose data is already available in the memory. Assume that there are enough free blocks at the end of the file and that the file control blocks are already in memory. Let the number of disk accesses required to insert a block in the middle of the file in A and B are nA and nB respectively, then the value of nA + nB is_________.Correct answer is '153'. Can you explain this answer?
    Question Description
    Consider two files systems A and B , that use contiguous allocation and linked allocation, respectively. A file of size 100 blocks is already stored in A and also in B. Now, consider inserting a new block in the middle of the file (between 50th and 51st block), whose data is already available in the memory. Assume that there are enough free blocks at the end of the file and that the file control blocks are already in memory. Let the number of disk accesses required to insert a block in the middle of the file in A and B are nA and nB respectively, then the value of nA + nB is_________.Correct answer is '153'. Can you explain this answer? for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about Consider two files systems A and B , that use contiguous allocation and linked allocation, respectively. A file of size 100 blocks is already stored in A and also in B. Now, consider inserting a new block in the middle of the file (between 50th and 51st block), whose data is already available in the memory. Assume that there are enough free blocks at the end of the file and that the file control blocks are already in memory. Let the number of disk accesses required to insert a block in the middle of the file in A and B are nA and nB respectively, then the value of nA + nB is_________.Correct answer is '153'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Consider two files systems A and B , that use contiguous allocation and linked allocation, respectively. A file of size 100 blocks is already stored in A and also in B. Now, consider inserting a new block in the middle of the file (between 50th and 51st block), whose data is already available in the memory. Assume that there are enough free blocks at the end of the file and that the file control blocks are already in memory. Let the number of disk accesses required to insert a block in the middle of the file in A and B are nA and nB respectively, then the value of nA + nB is_________.Correct answer is '153'. Can you explain this answer?.
    Solutions for Consider two files systems A and B , that use contiguous allocation and linked allocation, respectively. A file of size 100 blocks is already stored in A and also in B. Now, consider inserting a new block in the middle of the file (between 50th and 51st block), whose data is already available in the memory. Assume that there are enough free blocks at the end of the file and that the file control blocks are already in memory. Let the number of disk accesses required to insert a block in the middle of the file in A and B are nA and nB respectively, then the value of nA + nB is_________.Correct answer is '153'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
    Here you can find the meaning of Consider two files systems A and B , that use contiguous allocation and linked allocation, respectively. A file of size 100 blocks is already stored in A and also in B. Now, consider inserting a new block in the middle of the file (between 50th and 51st block), whose data is already available in the memory. Assume that there are enough free blocks at the end of the file and that the file control blocks are already in memory. Let the number of disk accesses required to insert a block in the middle of the file in A and B are nA and nB respectively, then the value of nA + nB is_________.Correct answer is '153'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Consider two files systems A and B , that use contiguous allocation and linked allocation, respectively. A file of size 100 blocks is already stored in A and also in B. Now, consider inserting a new block in the middle of the file (between 50th and 51st block), whose data is already available in the memory. Assume that there are enough free blocks at the end of the file and that the file control blocks are already in memory. Let the number of disk accesses required to insert a block in the middle of the file in A and B are nA and nB respectively, then the value of nA + nB is_________.Correct answer is '153'. Can you explain this answer?, a detailed solution for Consider two files systems A and B , that use contiguous allocation and linked allocation, respectively. A file of size 100 blocks is already stored in A and also in B. Now, consider inserting a new block in the middle of the file (between 50th and 51st block), whose data is already available in the memory. Assume that there are enough free blocks at the end of the file and that the file control blocks are already in memory. Let the number of disk accesses required to insert a block in the middle of the file in A and B are nA and nB respectively, then the value of nA + nB is_________.Correct answer is '153'. Can you explain this answer? has been provided alongside types of Consider two files systems A and B , that use contiguous allocation and linked allocation, respectively. A file of size 100 blocks is already stored in A and also in B. Now, consider inserting a new block in the middle of the file (between 50th and 51st block), whose data is already available in the memory. Assume that there are enough free blocks at the end of the file and that the file control blocks are already in memory. Let the number of disk accesses required to insert a block in the middle of the file in A and B are nA and nB respectively, then the value of nA + nB is_________.Correct answer is '153'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Consider two files systems A and B , that use contiguous allocation and linked allocation, respectively. A file of size 100 blocks is already stored in A and also in B. Now, consider inserting a new block in the middle of the file (between 50th and 51st block), whose data is already available in the memory. Assume that there are enough free blocks at the end of the file and that the file control blocks are already in memory. Let the number of disk accesses required to insert a block in the middle of the file in A and B are nA and nB respectively, then the value of nA + nB is_________.Correct answer is '153'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
    Explore Courses for Computer Science Engineering (CSE) exam

    Top Courses for Computer Science Engineering (CSE)

    Explore Courses
    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