Procedure retrieveMessage(msg: out message) is Remember to give priority to meat products. You may modify the existing procedure or create more appropriately named procedure. Pseudo-code to modify the body of procedure "retrieveMessage(msg: out message)" in "CircularQue.adb" giving preference to meat products might appear as follows. All other food products should be placed in stack 2. Modify the generic circular queue "CircularQue.ads/adb" (or better, replace the package) to allow insertion of arriving meat food packets in stack 1. We currently have a shortage of meat products. You should never need to use dynamic storage allocation in the heap (new or malloc in most languages)! Use of heap memory or inefficient space allocation/reclamation (linked list not allowed) will result in a loss of grade points and unduly irritate both ME and our customer! "B" stands for grain, vegetable or fruit products.Įach time "push" is invoked, the food product should be placed in the proper stack. When "push" is invoked, if there is no available space, the food product must be discarded and the number of discarded food packets increased by one. Stack Space (consisting of Maintenance records): The algorithms to manage the special case of two stacks occupying the same physical space is on the Data Structures notes approximately page 22 (and appendix "B" in the lab). Meat products should be placed in Sack 1 and other products in Stack 2. The top of stack 1 is currently at location 3 and the top of stack 2 at location 19 Locations 0 and 21 (if allocated, waste of space) do not have to physically exist, only logically exist. The stack space must be allocated dynamically in the stack, not the heap (Box1.ada)! The below diagram assumes a stack space from 1 through 20. To minimize waste, the two stacks must occupy the same physical space, for example locations 1 through 20 in the diagram below. We have been directed to replace the circular queue used in the "D" Option with two stacks - one for meat products, the other for non-meat products. "C": Option (maximum of 35 points): Deadline for submission to be announced. I am struggling to modify circularque.adb into a double stack and need help with it. Using the above appendix B, I need help with option C. Method SpaceAvailable should be return true if there is at least 1 space available else return false. The following algorithms have been suggested for the lab stack operations. 'Stack Space' (consisting of food product shipments):
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |