Hello,

I have been trying to turn this pesudo code into java code but i have been unsuccessfull. I need help doing this and any help would be appriciated

1.Initialise memory_block(0) = 99999
2.Computer initial_memory_waste = memory_block(0) – job_size
3.Inialise subscript = 0
4.Set counter to 1
5.Do while counter <= number of blocks in memory
If job_size > memory_size(counter)
counter = counter + 1
Else
memory_waste = memory_size(counter) – job_size
If initial_memory_waste > memory_waste
subscript = counter
Initial_memory_waste = memory_wast
counter = counter + 1
End do
6.If subscript = 0
put job in waiting list
Else
load job into memory(subscript)
adjust free/busy memory lists
7.Fetch next job


Thank you

Isn't this the exact same question you had in this thread in the Java forum, where I gave you a very detailed explanation of what you needed to do? You never even replied back. Shame. Guess I wasn't very helpful.

No sorry wasnt meant to be rude, i sent you a message thanking you dont know if you got it, your explanation really helped me out a lot. But this is a different problem i was reading in a book and i am just trying to turn it into java code

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.