Can someone help at least get started its due monday please

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Closed Thread

Join Date: Mar 2005
Posts: 12
Reputation: Iamhere is an unknown quantity at this point 
Solved Threads: 0
Iamhere Iamhere is offline Offline
Newbie Poster

please can someone help me how to start this program please its due monday

 
0
  #1
Mar 11th, 2005
Hi ppl I would really appreciate if someone help me out here. I really tried to do this problem and its driving me crazy. All I could get is the algorithum of worst fit, best-fit next fit and first fit. Please help me as soon as I can. And I will help ppl with anything I can.


Thanks
This is the prb please just help me started I would really appreciate the help

The problem it to implement first fit, best fit next fit and worst fit
1. must input mem size and the number and sizes of all the partitions
all the partitions (limit the max num of the partitions to 5)
2. for each partition you should create a descriptor with at least the following info.
partition size;
partition num;
partition status (free/busy)
size of unused space("hole")
job name (ex: j01 or j15)

input the job list that includes
job name;
job size
Last edited by Iamhere; Mar 11th, 2005 at 8:50 pm. Reason: shorter
Quick reply to this message  
Join Date: Sep 2004
Posts: 7,844
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 752
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Senior Bitch

Re: Can someone help at least get started its due monday please

 
0
  #2
Mar 11th, 2005
This is the third time you've asked the same question, maybe no one here can help you, but then again, maybe you're asking the question wrong. I'll leave this thread unlocked on the off chance that some kind soul wants to tell you what's wrong about your question.
New members chased away this month: 4
Quick reply to this message  
Join Date: Mar 2005
Posts: 12
Reputation: Iamhere is an unknown quantity at this point 
Solved Threads: 0
Iamhere Iamhere is offline Offline
Newbie Poster

Re: Can someone help at least get started its due monday please

 
0
  #3
Mar 11th, 2005
Narue can't you help me?
Quick reply to this message  
Join Date: Sep 2004
Posts: 7,844
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 752
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Senior Bitch

Re: Can someone help at least get started its due monday please

 
0
  #4
Mar 11th, 2005
Yes, I can. The instant you ask a smart question I'll be happy to.
New members chased away this month: 4
Quick reply to this message  
Join Date: Mar 2005
Posts: 12
Reputation: Iamhere is an unknown quantity at this point 
Solved Threads: 0
Iamhere Iamhere is offline Offline
Newbie Poster

Re: Can someone help at least get started its due monday please

 
0
  #5
Mar 11th, 2005
ok i know that the first_fit algorithum is

we set counter to 1
we do this while counter<=number of blocks in mem
if job_size > mem_size(counter)
then counter= counter+1
else
load job into mem_size(counter)
adjust free/busy memory lists
go to step 4
end do
put the job in waiting queue
go fetch the next job


best-fit
intialize mem_block(0)=99999
computer intial_mem_waste=mem_block(0)-job_size
intialize subscript=0
set counter to 1
Do while counter<=num of blocks in mem
if job_size>mem_size(counter)
then counter =counter+1
else
mem_waste=memory_size(counter)-job_size
if intial_mem_waste>mem_waste
then subscript=counter
intialize_mem_waste=mem_waste
counter=counter+1
end do
if subscript=0
then put the job in waiting queue
else
load job into mem_size(subscript)
adjust free/busy mem lists
go fetch next job


to load job in a fixed partition
determine job's requested mem size
if job_size>size of the largest partiton
then reject the job
print appropriate message to operator
go to step 1 to handle next job in line
else
continue with step 3
set counter to 1
do while counter<=number of partiotions in mem
if job_size>mem_partition_size(counter)
then counter=counter+1
else
if mem_partition_status(counter)="free"
then load job into memory_partition(counter)
change memory_partion_status(counter) to "busy"
go to step 1
else
counter=counter+1
end do
no partition available at this time put job in waiting queue get next job
go to step 1

deallocate mem blocks
if Job_location is adjacent to one or more free blocks
then
if job_location is btwn two free blocks
the merge all three blocks into one block
mem_size(counter-1)=mem_size(counter-1)+job_size+mem_size(counter+1)
set status of mem_size(counter+1) to null entry
else
merge both blocks into one
mem_size(counter-1)=mem_size(counter-1)+job_size
else
search for null entry in free mem list
enter job_size and beginning_address in the entry slot
set its status to "free"

Ok my question is how would or can you help me code this properly please?
Quick reply to this message  
Join Date: Feb 2002
Posts: 12,056
Reputation: cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light 
Solved Threads: 128
Administrator
Staff Writer
cscgal's Avatar
cscgal cscgal is online now Online
The Queen of DaniWeb

Re: Can someone help at least get started its due monday please

 
0
  #6
Mar 11th, 2005
As Narue pointed out, you already asked this question, where you received some help on it. To help keep this site organized, and to help you find the answers you're looking for, we request that you only start one thread per question.

I am locking this thread. Everyone can participate in the other thread at http://www.daniweb.com/forums/thread19839.html
Dani the Computer Science Gal
Follow my Twitter feed! twitter.com/DaniWeb
And if you're interested in Internet marketing there is twitter.com/DaniWebAds
Quick reply to this message  
Closed Thread

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C Forum
Thread Tools Search this Thread



Tag cloud for C
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC