Jump to content
Urch Forums

question 61 Practice book


Vinay

Recommended Posts

  • 2 weeks later...

Vinay. This one is tricky but not too difficult.

 

We should be covering the case were the "certain" request will allocate 10 words, and not 3, because in order to have a minimum number of allocated words in the memory, they should be spaced as max as possible.

 

So, the maximum number of spaces between allocated words should be 9, because if it is 10, the request succeeds. By the same token, the size of the allocated words should be the minimum possible: 3. So, the first 12 words of memory are comprised of 9 empty words and 3 allocated ones. Subsequently, you get another batch of 12 words until reaching 105:

 

12 - 24 - 36 - 48 - 60 - 72 - 84 - 96

 

... and from 96 to 105, you have the last 9 empty words.

 

So, you have 8 batches of 12 words, which are as well 8 batches of 3 allocated words. So the minimum amount of words you can have allocated in order to reject a request is therefore 24. Answer is B.

 

Link to comment
Share on other sites

Think of something like this:

 

You need to fit a piece of wood of length 10cm into a 105cm straight line, containing some pillars. What's the case you won't be successful? You'll fail to place it if there are just 9cm blocks of spaces available in the whole length of the line... i.e., you can't place a 10cm piece of wood into a 9cm space. So, there's always a pillar filled in the 10th position, 20th position, 30th.... inhibiting the 10cm piece of wood to get placed.

 

However, in this particular problem, the minimum number of spaces that a pillar can occupy is not 1, but 3 spaces (a memory block is at minimum 3 words in the problem). Hence, you need 9 empty spaces + 3 occupied words... then you can have again 9 empty spaces, and 3 words... until you reach 105cm.

 

Memory:

|---------+++---------+++---------+++---------.......|

 

|___9sp____3____9sp____3____9sp____3_________________|

 

|_____12____|_____12____|_____12____|_____12____|....|

 

 

Let me know if it is still not clear... I'll try to draw some non-ASCII ones! ;)

 

Wood

Link to comment
Share on other sites

okay so everytime it looks to allocate 10, it finds first of the 3 consecutive words and this goes on till the last 9.

 

so till tht time 8 of the 3's have been allocated tht makes it to 3*8=24 and no 9's.

 

this means tht allocator cannot find a fit for 10 consec. words and the rest of memory is full so it just gives up and at tht time 24 words r in use.

 

am i right?

 

but whts the use of giving free function here ????

 

Vinay

Link to comment
Share on other sites

Originally posted by wood

 

If we keep posting... we'll attract more people...

 

Yesterday, I was browsing the net for more info on GRE CS and guess what? I found our links here: me asking Erin to create a forum, your recent links posted, etc... They'll come! :D

Yes, Google crawls us pretty regularly.

 

I'll try to promote the GRE Subject forums in a newsletter, too. That should help a bit. :D

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...