Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Simulate the Linked File allocation method in C/C++. ALGORITHM: Step 1: Create a queue to hold all pages in memory Step 2: When the page

Simulate the Linked File allocation method in C/C++.

ALGORITHM:

Step 1: Create a queue to hold all pages in memory

Step 2: When the page is required replace the page at the head of the queue

Step 3: Now the new page is inserted at the tail of the queue

Step 4: Create a stack

Step 5: When the page fault occurs replace page present at the bottom of the stack

Step 6: Stop the allocation.

OUTPUT:

Enter no. of files:2

Enter file name: file1

Enter starting block:20

Enter no.of blocks:6

Enter block numbers: 4

12

15

45

32

25

Enter file name: file2

Enter starting block:12

Enter no.of blocks:5

Enter block numbers:6

5

4

3

2

File start size block

File1 20 6 4--->12--->15--->45--->32--->25

File2 12 5 6--->5--->4--->3--->2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions