1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Rom4ik [11]
3 years ago
7

Contrast the performance of the three techniques for allocating disk blocks (contiguous, linked, and indexed) for both sequentia

l and random file access. [12 marks]
Computers and Technology
2 answers:
sladkih [1.3K]3 years ago
5 0

Answer:

There are three main disk space or file allocation methods.  

• Contiguous Allocation  

• Linked Allocation  

• Indexed Allocation

By the performance level  

Contiguous allocation > linked Allocation > Indexed Allocation

Contiguous is faster than linked allocation and both contiguous and linked are faster than indexed.

As  linked allocation does not support direct access and the indexed allocation , the pointer of it is bigger than linked allocation  

Explanation:

1.Contiguous Allocation :

In this scheme, each file occupies a contiguous set of blocks on the disk.

> It supports both accesses (sequential and direct)

> Its extremely fast as the number of seeks are minimal because of contiguous allocation of file blocks.

but on the other hand it has some disadvantages as

> It can not deal with fragmentation whether its external or internal.

> And also increasing the size of it may get difficult.

2. Linked Allocation:

In this type of allocation, each file is a linked list of disk blocks and the disk blocks can be scattered anywhere on the disk.

> This type is very flexible with the file size.  

> This method also does not suffer from external fragmentation. This makes it better in terms of memory utilization.

> It does not support random or direct access while it slightly support sequential access.

3. Indexed Allocation:

There is a special block known as the Index block contains the pointers to all the blocks occupied by a file in this type of allocation. Each file has its own index block.  

> This type supports direct access therefore provides fast access to the file blocks.  

> It also overcomes with the problem of external fragmentation.

Pie3 years ago
3 0
The allocation methods define how the files are stored in the disk blocks.
There are three main disk space or file allocation methods:
1.Contiguous Allocation-in this scheme,each file occupies a set of blocks on the disk. For example if a file requires x blocks and is given a block y as the starting location,then the blocks assigned to the file be :x,y+1,y+2,......y+x-1.
This means that given the starting block address and the length of the file(in terms of blocks required) we can determine the blocks occupied by the file.
Advantages
-both the sequential and direct accesses are supported
-this is extremely fast since the number of seeks are minimal because of contiguous allocation of file blocks.
2.linked allocation-in this scheme,each file linked list of disk blocks which need not  be contiguous disk blocks can be scattered anywhere on the disk.
Advantages
it is very flexible in terms of file size.file size can be increased easily since the system does not have to look for a contiguous chunk 
of memory.
this method does not suffer from external fragmentation and it makes it relatively better in terms of memory utilization.
3.Indexed Allocation-in this scheme,a special block known as the index block contains the pointers to all the blocks occupied by a file.Each file has its own index block.the entry in the index block contains the disk address of the block
Advantages
it supports direct access to the blocks occupied by the file and therefore provides fast access to the file blocks
it overcomes the problem of external fragmentation.
You might be interested in
OH NO THE HEAVY IS DEAD
Anarel [89]

Answer:

what does that mean?

are you okay?

Did something happen?

4 0
3 years ago
Read 2 more answers
Create a class Str that subclasses str. Add a method to the subclass that checks if the string does not start with a given strin
Stolb23 [73]

Answer:

#include <iostream>

using namespace std;

class Str{  ///baseclass

   public :

   string super_str;

   string getStr()

   {

       return super_str;

   }

   void setStr(string String)

   {

       super_str=String;

   }

};

class str : public Str{   //inheriting Str publicly

   public :

       string sub_str;

       string getstr()

       {

           return sub_str;

       }

       void setstr(string String)

       {

           sub_str=String;

       }

       bool notstartswith()

       {

           int n=sub_str.length();   //to find length of substr

           bool flag=false;

           for(int i=0;i<n;i++)     //Loop to check beginning of Str

           {

               if(super_str[i]!=sub_str[i])

               {

                   flag=true;

                   break;

               }

           }

           return flag;

       }

};

int main()

{

   str s;    //object of subclass

   s.setStr("Helloworld");  

   s.setstr("Hey");

   if(s.notstartswith()==1)     //checking if str is substring of Str

       cout<<"Str does not start with str";

   else

       cout<<"Str starts with str";

   return 0;

}

OUTPUT :

Str does not start with str

Explanation:

Above program is implemented the way as mentioned. for loop is being used to check the beginning of the str starts with substring or not.

3 0
3 years ago
What does the following code do? Assume list is an array of int values, temp is some previously initialized int value, and c is
BigorU [14]

Answer:

Option D is correct.

Explanation:

Option D is correct because  when the condition  if (list[j] < temp) is tested it only gets true when element in list[] array at <em>jth</em> position is less than the value in <em>temp</em> and after that it increments the value of c by this statement: c++ and so c is incremented from 0 to as much times as much elements in list[] are lesser than temp.

6 0
3 years ago
Read 2 more answers
In discussing inventory, Helena mentions that bikinis for sale on the website are not always in stock. Say customer feedback ind
alekssr [168]

Answer:

decide that when online customers and retail stores order bikinis, they will never have to wait more than two weeks for the order to arrive.

Explanation:

Based on the information provided within the question it can be said that in this scenario the best action that Helena can take is to decide that when online customers and retail stores order bikinis, they will never have to wait more than two weeks for the order to arrive. Otherwise she will begin to lose customers constantly by not having stock or shipping the product in time. These losses will continue to amass and may eventually ruin her business.

6 0
3 years ago
Write a loop that fills an array int values[10] with ten random numbers between 1 and 100. Write code for two nested loops that
zalisa [80]

Answer:

#include <iostream>

#include <cstdlib>

using namespace std;

int main() {

   int[] array = new int[10];

   int index = 0;

   while(index < array.size()){

           int number = (rand() % 100) + 1;

           for (int i = 0; i < 1; i++) {

               array[index] = number;

               cout<< "Position "<< index << "of the array = "<< number << endl;

               ++index;

           }

     }

}

Explanation:

The while loop in the source code loops over a set of code ten times, The for loop only loops once to add the generated random number between 1 and 100 to the array of size 10. At the end of the for loop, the index location and the item of the array is printed out on the screen. The random number is generated from the 'rand()' function of the C++ standard library.

7 0
3 years ago
Other questions:
  • How do you think your ability to work might be affected if you don’t magnify a document so that text is at a size for you to rea
    9·1 answer
  • What is the purpose of the chart feature in word?
    15·1 answer
  • Which screen should be open to customize or personalize a desktop background
    11·1 answer
  • Whois the person start programming​
    13·1 answer
  • Mary recently read about a new hacking group that is using advanced tools to break into the database servers of organizations ru
    14·1 answer
  • What are some things that games were historically used for?
    7·1 answer
  • Your company decided to upgrade the older office Ethernet network and needs the fastest speed possible but has decided against f
    8·1 answer
  • Ron is creating building blocks in Word. How can he make the building blocks that he created available?
    10·2 answers
  • Barbara, an employee, has properly connected her personal wireless router to a network jack inside her office. The router is una
    7·1 answer
  • 1. The supervisory software of a computer is called _____ (a) operating system (b) high – level language (c) transistor
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!