Question: ive attached reference code for task 1 Partitioned Blocks - Memory Block Size Block 150k Block 2200k Block 370k Block 4115k Block 515k Process- Process

ive attached reference code for task 1
ive attached reference code for task 1 Partitioned Blocks - Memory Block
Size Block 150k Block 2200k Block 370k Block 4115k Block 515k Process-
Process Number Size Process 1100k Process 210k Process 335k Process 415k Process

Partitioned Blocks - Memory Block Size Block 150k Block 2200k Block 370k Block 4115k Block 515k Process- Process Number Size Process 1100k Process 210k Process 335k Process 415k Process 523k Task 1: For the above table show me the output of which process assigned to which block using first fit and best fit algorithm source code Task 2: Implement worst fit algorithm and For the above table show me the output of which process assigned to which block, using worst fit algorithm. (graduate student only) Back first-fit-1.py Switch To Light Mode \# First Fit def firstFit(blocksize, m, processsize, n ): allocation =[1]n for i in range (n) : for j in range (m) : if blocksize[j] >= processsize[i]: allocation [i]=j blocksize[j] processsize[i] break print(" Process No. Process Size Block no.") for i in range (n) : if allocation[i] t=1 : else: print(allocation [i] +1) print( "Not Allocated") if name == ' main ': m= int (input ("Enter the block size: ")) n= int (input ("Enter the process size: ")) blockSize = 1 ist (map( int, input ("Enter block sizes: "). split()) ) processsize =1 ist ( map (int, input (" "enter process sizes: ").split())) firstFit(blocksize, m, processSize, n ) Back best-fit-1.py Switch To Light Mode \# Best Fit def bestFit(blocksize, m, processsize, n ): allocation =[1]n for i in range (n) : best Idx =1 for j in range (m) : processsize [i]: if blocksize [j]>= if bestIdx = =1 : allocation [i]= bestIdx blocksize [bestIdx] =- processSize [i] print("Process No. Process Size Block no.") for in in range (n) : processsize[i],end="ifallocation[i]!,1:else:print(allocation[i]+1) print( "Not Allocated") if name = ' main ': n = int (input ("Enter the process size: ")) blockSize = list (map (int, input ( "Enter block sizes: ").split())) processsize =1 ist ( map ( int, input ( "Enter process sizes: ").split())) bestFit(blocksize, m, processsize, n )

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!