Question: 1. Using a linked list in C language, create a queue of elements where each element has a minimum of the following information: (a) Element

1. Using a linked list in C language, create a queue of elements where each element has a minimum of the following information: (a) Element identifier; (b) Element priority. When run, your program displays the following menu: 1. Add element; 2. Remove element; 3. Display elements; 4. Exit. The menu choices have following functionality: 1. [4 points] Add element: An element is created and a unique element identifier is automatically assigned to it. The user must provide a priority for the element. The priority can be a number between 1 and 10, where 1 represents the lowest priority. The element is added to the queue such that elements are stored in order of decreasing priority. The queue always has the highest priority element at the front 2. [2 points] Remove element: The element at the front of the queue is displayed (Identifier and priority) on the console and then removed. After the removal, the element with the next highest priority is at the front of the queue. 3. [1 points] Display elements: The list of elements is displayed. Display element location, identifier, and element priority. 4. Exit: Your program releases all the memory used. That is, empty the list before exiting the program. 2. [3 points] Implement a stack for the same element used in the previous problem. Your stack must be based on a linked list. Your program must allow a user to add, remove, and display stack items. You can use the same menu as the one used in the previous problem. Make sure to de-allocate all the memory once it is no longer needed
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
