3 Replies - 1953 Views - Last Post: 14 October 2012 - 08:14 PM

#1 koricha  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 85
  • Joined: 08-February 12

First fit algorithm

Posted 12 October 2012 - 03:12 PM

lets say i have a Variable Partitioning with free space: at address 32k a free space of 8k, and at address 15k a free space of size 11k.

i need to create a BEST FIT free table.

am i doing the right thing please help.

    +--------+-------+
    |address | size  | 
    |32      |8      |
    |15      |11     |
    +--------+-------+


This post has been edited by koricha: 12 October 2012 - 03:57 PM

Is This A Good Question/Topic? 0
  • +

Replies To: First fit algorithm

#2 koricha  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 85
  • Joined: 08-February 12

Re: First fit algorithm

Posted 14 October 2012 - 07:43 PM

this is a free space table

+--------+-------+
|address | size  | 
|   28   |  11   |
|   21   |  19   |
+--------+-------+


the following data enters :11, 5, 7

i need to place the each data in the right place using first fit algorithm

am i doing this right please help

(step 1) 11 will be placed at address 28 at size 11

(step 2) 5 will be placed at address 21 by dividing 19 into two pieces, so 14 is created (new partition)

(step 3) 7 will be placed at address 21 at size 14 that is creates in step (2)
Was This Post Helpful? 0
  • +
  • -

#3 ccubed  Icon User is offline

  • It's That Guy
  • member icon

Reputation: 162
  • View blog
  • Posts: 1,407
  • Joined: 13-June 08

Re: First fit algorithm

Posted 14 October 2012 - 08:09 PM

Assuming the data numbers are sizes. Then yes, that is correct.

Thing to remember about first fit is this: If you think you're overthinking it, you are. It is a really simplistic method of bin sorting. It is literally these three steps.

1) Goto next bin
2) Room?
2a) Room. Put it in.
2b) No room. goto 1.

This post has been edited by ccubed: 14 October 2012 - 08:10 PM

Was This Post Helpful? 0
  • +
  • -

#4 koricha  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 85
  • Joined: 08-February 12

Re: First fit algorithm

Posted 14 October 2012 - 08:14 PM

thank you ccubed very helpful
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1