Priorty Queues : Bin Packing (aka Bin Loadin')

An interesting and useful assignment based on Priority Queues involving optimizing the packing of items in bins appears on the website for Princeton's COS 226 course,

Task. Develop the project, WorstFit, and drop in this WorstFit.java driver. You are to complete the allocate(int fileSize) method that will attempt to add the sample file sizes read from the input file input20.txt, to the Disk object at the top of the maxPQ maximum heap object. If this Disk does not have sufficient free space to accomodate the request, instantiate another Disk, decreasing the available space by the amount requested and add the Disk to the maxPQ. Other input files can be taken from Princeton's ftp support site. The MaxHeapPriorityQueue class is a modification of the HeapPriorityQueue class we worked on in class. You'll find this in our First Class Subject Conference. You are to submit WorstFit.java, Disk.java and MaxHeapPriorityQueue.java by the deadline. You will develop the Disk class as defined by the UML diagram.