10.6 Maintain two queues, Q1 and Q2. Q1 will store single-node trees in sorted order, and Q2 will store multinode
10.10 To implement first fit, we keep track of bins bi, which have more room than any of the lower numbered bins.
A theoretically easy way to do this is to maintain a splay tree ordered by empty space. To insert w, we find
To implement best fit, we need to keep track of the amount of empty space in each bin. As before, a
splay tree can keep track of this. To insert an item of size w, perform an insert of w. If there is a bin that can
10.11 Next fit: 12 bins (.42, .25, .27), (.07, .72), (.86, .09), (.44, .50), (.68), (.73), (.31), (.78, .17), (.79), (.37), (.73,
Best fit: 10 bins (.42, .25, .27), (.07, .72, .09), (.86), (.44, .50), (.68, .31), (.73, .23), (.78, .17), (.79), (.37, .30
Best fit decreasing: 10 bins (.86, .09), (.79, .17), (.78), (.73, .27), (.73, .25), (.72, .23), (.68, .31), (.50, .44),