Musatov
unread,Feb 5, 2011, 8:14:57 PM2/5/11You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
<b>binpackFFd(S,n,bin)</b>
float[] used=new float[n+1];
//used[j] is the amount of space in bin j already used up.
inti,j;
Initialize all used entries to 0.0
Sort S into descending(nonincreasing)order,giving the sequence
s1>=S2>=...>=Sn.
for(i=1;i<=n;i++)
//Look for a bin in which s[i] fits.
for(j=1;j<=n;j++)
if(used[j]+si<+1.0)
bin[i]=j;
used[j] +=si;
break; //exit for(j)
//continue for(i).