Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Page Replacement Algorithm Program Code In Python Using The Skeleton Code Provided Below. ''' Simple FIFO Page Replacement Algorithm ''' Def FIFO(Size, Pages): F =

Page Replacement Algorithm Program Code In Python Using The Skeleton Code Provided Below. ''' Simple FIFO Page Replacement Algorithm ''' Def FIFO(Size, Pages): F = -1 Faults = 0 # Just A Value Used In Skeletal Code To Make It Execute Page = [] For I In Range(Pages): Page.Append(-1) Return Faults ''' LRU Algorithm ''' Def

Page replacement algorithm Program code in python using the skeleton code provided below.

''' Simple FIFO page replacement algorithm ''' def FIFO(size, pages): f = -1 faults = 0 # just a value used in skeletal code to make it execute page = [] for i in range(pages): page.append(-1) return faults

''' LRU algorithm ''' def LRU(size, pages): faults = 0 # just a value used in skeletal code to make it execute return faults

def main(): pages = (7,0,1,2,0,3,0,4,2,3,0,3,2,1,2,0,1,7,0,1)

size = int(input('Enter number of frames: '))

print('The FIFO algorithm had', FIFO(size,pages), 'page faults.')

print('The LRU algorithm had', LRU(size,pages), 'page faults.')

main()

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Combinatorial Testing In Cloud Computing

Authors: Wei-Tek Tsai ,Guanqiu Qi

1st Edition

9811044805, 978-9811044809

Students also viewed these Programming questions

Question

Why is it important to have a dream? (p. 49)

Answered: 1 week ago

Question

2. What is the meaning and definition of Banking?

Answered: 1 week ago

Question

3.What are the Importance / Role of Bank in Business?

Answered: 1 week ago