now let's see about allocation methods are finally regression methods generally files are stored in secondary storage devices such as hard disk so final equation methods allows the operating system to yellow the hard disk space for the files so that the hard disk space can be used in effective manner yes well as the files can be accessed in a faster manner so Riera by using file allocation methods operating system allocates disk space for the files here operating system allocates the space for the files by keeping two points in mind the first one is in order to utilize the hot disk space in efficient manner and the second goal is a' so that the files can be accessed in a faster manner so by keeping these two goals in mind operating system allocates space for device there are three types of final equation methods are available first one is contiguous allocation second one is link orientation third one is indexed allocation so let's see the first one contiguous allocation the name itself specifies the meaning so in this approach if set of contiguous blocks will be allocated for your file I let here let the size of your block user to give me the size of a block is to kill me let file name is EA let size of F is now 20 KB so what is the size of each blow to KB obvious what is the size of a - DK B so if you just continue segregation then totally ten blocks needs to be allocated for a ten contiguous blocks needs to be allocated for you let us assume that the size of each block is forgiving then 20 contiguous blocks needs to another finding okay so this is about contiguous allocation so this is the hardest as finance this one is nothing but finalization table so in hard disk we have totally 12 blocks ranging from 0 to 11 okay so totally we have how many blocks 12 blocks okay so this is nothing but fine annotation maple so Phi dedication table contains the information about each and every file that is stored in the secondary storage that is nothing but artists it mainly contains three columns the first column is name of the file second column is bounty block neighbor and the third column is length of that down fine okay so here the FASTA file name you see a starting block is fun so that means this is that wrong and what is the length of this year three blocks so one two three three blocks so Phi a is occupied by these three blocks 1 butene so for each file we can have a single entry in the file allocation table let us observe the second row so name of the file is be a various the starting block number is fine so this is 50 black very has what is the length of the block what is the length of the file 2 blocks so 5 6 1 to say these 2 are occupied by P and next we have one more row that you see about see information the starting block number is 8 as well as what is the length of the file 2 blocks so these two blocks are occupied by C so this is about 5 irrigation table so Phi dedication table contains the information about the files which are stored in the hard disk and now let us analyze the advantages and disadvantages of this approach the first advantage of this approach is it is simple to implement why because we need only a contiguous set of blocks and in those blocks operating system allocates space for the files so we can implement this approach in the easiest manner and it is best suited for sequential file so sequential file means the records can be at one by one okay so if we have sequential and find accessing then contiguous allocation is the best one why because here also we are allocating memory in contiguous blocks sequential means accessing record by record okay so these are the advantages and the disadvantages are difficult to find the contiguous blocks okay so let us assume that we need to have hundred blocks okay so it is very very difficult to find out hundred contiguous blocks at once so that is the first disadvantage here and the second disadvantage is external fragmentation so we know what is external fragmentation a sufficient blocks are avoidable in the hard disk but they are available at different locations the first to five blocks are available at once second second five blocks are available yet the ones are five blocks are available yet one more location like that external fragmentation means sufficient free blocks are available but operating system County allocates those blocks for the file why because those blocks are non contiguous okay so this is XML fragmentation so this is the problem here we know that we can solve the external fragmentation with the help of a compaction but compaction is very very expensive approach so in order to all of these problems we can use as the second approach that is linked by definition now let's see the second approach that is linked revocation it is based upon the link released we know what is a linked list or here we can have a collection of blocks where in each block we can have your pointer field so the first block point that contains address of the second block second block pointer contains address of the third block third block a pointer contains address of the fourth block like that so we can say that this approach is based upon individual blocks so let us observe the stack so this is nothing but our secondary storage device that that is nothing but hard disk here we can have fun blocks from zero to 11 so this is nothing but finalization table here the five irrigation table contains the columns the first column is finding the second column is starting block number variants the third column is ending block number of areas in contiguous allocation in fire allocation table the last column the last one is length length of the corresponding find so how many blocks does it occupy a various here the third column is ending block member so here name of the fire so what is the starting block member so this one so this one is the starting block member whereas in big block member is nothing but 10 so this is nothing but our last block various this money is nothing but I'm a starting block okay so this block contains a pointer so this pointer points to the address of the next block that is nothing but fourth block next to this block contains address office next to block that is nothing but view to block next filter block contains a pointer it contains address office net bench to block that is nothing but ninth block next to this block contains address off it's next to block that is nothing but empty block so here what is the last block here and is the last block here so in this way we can allocate memory to the file with the help of a simple list let us see the advantage here the major problem with contiguous allocation is it suffers with external transplantation am areas here external fragmentation that doesn't erase here why because whenever there is a free block then simply we can master on shaming from that block of that block okay so there is no external fragmentation here and the second advantage is it is best suitable for sequential file because sequential file means we can access the regards one by one so it is best suited for that approach and let us see the drawbacks the first drawback is here in each block we have to maintain a pointer so we need to store the pointer in order to store the point that we require much amount of memory and the second problem is it will take small amount of time' in order to perform the traversing let us assume that here we have getting the list with the hundred blocks if you want to access the last hundred block then we need to access all its previous blocks that is nothing but 99 blocks so for accessing if he takes more amount of time so we can welcome these problems with the help of the theory approach the third approach is index navigation here it is based upon index block as it has observed the final location table name of the file is a index blog is fun ok now this block limit contains the addresses alpha all the blocks here if you take linked list then first block contains a trace of second block second block second block our pointer field contains address of the dot block third block pointer field contains address of the fourth block like that various if we take indexed allocation a single block contains addresses alpha the blocks which are allocated for that file ok so here now this is nothing but you next block so index no endanger the block numbers which were allocated by the fine okay so the first block here is zero so far from one to zero we have a link next block is three here what is the next block 1 so from 1 to 3 we have heavy next block is food so from 1 to phone we have hitting next block is fight so from 1 to 5 we have hit next to block you 6 so from 1 to 6 we have unique okay so this is nothing but indexed allocation so it will take less amount of memory than a link 11 Clinton navigation let us see the advantages here it supports both sequential and random files random 5 means we can access any blocked directly ok here index block contains all the profits so from 1 to 4 we can go directly so from 1 to 6 we can go directly various that is not possible in our linearization ok and the second advantage is there is no external fragmentation here why because there is no need to allocate the memory in contiguous blocks and the third advantage is whenever file size increases then we can easily add the new blocks to the index block simply we have to store the new block addressed in this map okay so this is about fine allocation methods