Login|Contact Us
Question and Answer

Programming

Ask a Programming Question, Get an Answer ASAP!

  • Ask A Question
  • Browse Answers
  • Meet The Experts
  • How JustAnswer Works

4. Given the following information JOB LIST JOB

 
abhi_iitian's Avatar
  • Answered by:abhi_iitian
  • Computer Software Engineer
  • Positive Feedback: 100.0 %
  • Accepted Answers: 79
Verified Expert
in Programming

Recent Feedback

Positive
Great effort
Positive
Hey people... Abhi & Just are a 'No.1' item... check him out... johng
Positive
Great help!!
Positive
I just got my computer back from a Tech today. While we were unable to fix my...
Positive
He would NOT be beaten with my problem & finally solved the problem.
Positive
I don't know anything about paying but he finally got me back online Thanks
Positive
His answer did work.
Positive
thanks. Great service. The company I work for has an office in Bangalore, India....
Positive
Great
Positive
very satisfied!!!

Customer Question

4. Given the following information
JOB LIST:
           JOB #                    MEMORY REQUESTED

J1                    740k
J2                    500k
J3                    700K
MEMORY LIST:
     MEMORY BLOCK          SIZE
     Block 1               610k (low-order memory)
     Block 2               850k
     Block 3               700k (high-order memory)
a.     Use the best-fit algorithm to allocate the memory blocks to the three arriving jobs.
b.     Use the first-fit algorithm to allocate the memory blocks to the three arriving jobs.

Submitted: 1486 days and 8 hours ago.
Category: Programming
Value: $20
Status: CLOSED

Accepted Answer

Picture
Expert:  abhi_iitian replied 1486 days and 8 hours ago.

Hello, Thanks for using just answers.

Answer is :
a. Best -Fit Algorithm - In best-fit algorithm , the arriving job is allocated the smallest memory chunk available which is large enough to provide the memory requested by that job.
So here, J1 , only chunk large enough is Block2 so, Block 2 is allocated to J1
J2 arrives, Now Block 1 and Block 3 are available (as Block 1 has been allocated ) and large enough to provide the requested memory but the smallest of them is Block 1, so J2 is allocated Block 1

J3 arrives, Now Block 3 is available (as Block 1 and Block 2 have been allocated ) and large enough to provide the requested memory, so J3 is allocated Block3

b. First -Fit Algorithm - In this algorithm, the arriving job is allocated the first memory chunk available which is large enough to provide the memory requested by that job.

So here, J1 arrives, Block 1 is not large enough, so first chunk large enough is Block2, so Block 2 is allocated to J1
Now, J2 arrives, Operating system checks if block 1 is large enough , it is large enough and available , hence block1 is assigned to J2
Now, J3 arrives, Operating system checks for the first available chunk which is block3 and it is large enough, hence block3 is assigned to J3

So, Order is :
Process MEMORY BLOCK
J1 Block 2
J2 Block 1
J3 Block 3


So here in both algorithms , we have got same allocation which is not the case always. It will differ with the order of arrival of processes.
e.g if order is 700k,500k,740k , in best fit, allocation will come to be same when we apply the algorithm but in first-fit, it will be 700k to Block2 , 500K to Block 1 and third process(740K) will have to wait for the 500Kprocess to finish so that it can get that memory block.

Expert TypeComputer Software Engineer
Category: Programming
Pos. Feedback: 100.0 %
Accepts: 79
Answered: 3/11/2009

Experience: B-Tech Topper in CSE from IIT Roorkee, Experience as S/W design Engineer at Microsoft India

Ask this Expert a Question >
 
Tweet

8 Programmers are Online Right Now

Ask Your Question Now
Programming Questions Date Submitted
is there a python programming person available 3/28/2013
Write a menu-driven program that allows users do two options: Option 3/27/2013
1. Which one of the following control structures provides for 3/27/2013
JavaScript: Multiple Choice Questionnaire 3/25/2013
RA-211 3/24/2013
How do you create a searchable public Google drive folder in 3/24/2013
RA-211 3/24/2013
I am an entrepreneur with no current coding skills, but an 3/23/2013
I have base code in VBA that opens all excel files from a folder 3/23/2013
Program in C++ 3/23/2013
RSS
Next 10 >
Ask A Programmer
Type Your Programming Question Here...
characters left:

Top Programming Experts

See More Programmers

In The News

Nbc
Washington Post
New York Times
Cnn
Learn More

How It Works

  • Ask an Expert
  • Get a Professional Answer
  • Ask Followup Questions
  • 100% Satisfaction Guarantee
Learn More
close
Find Expert answers related to your question.
Sign up using email
We will never post anything without your permission.
Already have an account? Sign in

Ask a Programmer

Get a Professional Answer. 100% Satisfaction Guaranteed.
182 Programmers are Online Now
Type Your Programming Question Here...
characters left:
Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.
Truste
Contact Us | Terms of Service | Privacy & Security | About Us
© 2003-2013 JustAnswer LLC