Free help with homework

Why join Brainly?

  • ask questions about your assignment
  • get answers with explanations
  • find similar questions

0.6 1.5

1.6 0.2
0.4 0.5
0.7 0.1
0.9 0.3

(a) Use the first-fit bin
packing algorithm to determine how the numbers listed above can be packed into
bins of size 2.




This Is a Certified Answer

Certified answers contain reliable, trustworthy information vouched for by a hand-picked team of experts. Brainly has millions of high quality answers, all of them carefully moderated by our most trusted community members, but certified answers are the finest of the finest.
       0.2          0.3  
       0.6          1.5        1.6        0.9
bin:   A            B           C         D

Using the first fit  packing algorithm to pack items (numbers) into bins of size 2.
For Each number that arrives to be packed, check the first bin for available empty space based on the size of number. If it fits, put it in that bin. Otherwise, open a new bin and put it it that bin. Update & note the remaining empty space in that bin.
when we say number fits in a bin,
         number size <= empty space in the bin.
         empty space in the bin = bin size - sum of the numbers already in bin

At First there are  no bins.
1. In arrives first number (item) 0.6. We have no existing bin that can hold this.
   So open a new bin  A.  Put 0.6 in bin A. 
2. In comes number 1.5. It cannot fit in bin A as empty space in that is only 1.4,
   so open bin B and put 1.5 in it. 
3. Now 1.6 comes in, it can not fit in Bin A, cannot fit in B, so open new bin C
   and put it in C.
4. Now comes 0.2, it fits in bin A.   put it in A.
5. Now for 0.4, it fits in bin A. put it in A
6. Comes in 0.5, fits in bin A. put it in bin A
7. comes in 0.7, fits in A.  put it in bin A
8. comes in 0.1 , fits in A.  put it in bin A
9. comes in 0.9,  does not fit in A, or B or C. So open bin D. put 0.9 in bin D
10.  comes in 0.3,  does not fit in A. but fits in B.  put it in bin B.

 0.2      0.3  
 0.6      1.5    1.6    0.9
  A        B      C      D

0 0 0
The Brain
  • The Brain
  • Helper
Not sure about the answer?
Learn more with Brainly!
Having trouble with your homework?
Get free help!
  • 80% of questions are answered in under 10 minutes
  • Answers come with explanations, so that you can learn
  • Answer quality is ensured by our experts