Question: For the final exam, you will implement a priority queue using linked list in ARM assembler. A priority queue is a variation on the standard
For the final exam, you will implement a priority queue using linked list in ARM assembler. A priority queue is a variation on the standard queue. The standard queue is a collection of elements managed in a first-in, first-out manner. The first element added to the collection is always the first element extracted; the second is second; so on and so on. In some cases, a FIFO strategy may be too simplistic for the activity being modeled. A hospital emergency room, for example, needs to schedule patients according to priority. A patient who arrives with a more serious problem should preempt others even if they have been waiting longer. This is a priority queue, where elements are added to the queue in arbitrary order, but when time comes to extract the next element, it is the highest priority element in the queue that is removed. Such an object would be useful in a variety of situations. The priority queue will be a collection of nodes each containing an integer value. Your code will read from a file containing the integer value to be inserted along with it priority. For example: File queue.txt (with priority 1 being highest): (you dont need to include the text value and priority in your input file. Value priority 5 4 10 1 4 2 12 4 7 3 Etc... Using the queue.txt file above, the priority queue generated should look like this: Node(12, 4) Node(5, 4) Node(7, 3) Node(4, 2) Node(10, 1) NULL Note the order of the nodes in the queue are based on the priority of the node. If two nodes have the same priority value, then the one that was inserted first will be deleted first (see the order of nodes containing 5 and 12). To delete from the priority queue, you simply just remove the last node in the queue, i.e. Node(10, 1), because it has the highest priority. You must write your code FROM SCRATCH NOT AUTO C CONVERT in ARM assembly to run on the Raspberry Pi. As a hint, you may want to consider starting with the link list
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
