Question: ll cricket LTE Lab 2.doc Use Word to process your homework and submit to Blackboard is mandatory. Source code and screenshot are required. 1. (100

 ll cricket LTE Lab 2.doc Use Word to process your homework

ll cricket LTE Lab 2.doc Use Word to process your homework and submit to Blackboard is mandatory. Source code and screenshot are required. 1. (100 points) A queue is a data structure that stores data according to the first-in-first-out rule. Functions that manipulate data in a queue inclu de: enq0-add a data item to a queue at the tail deq0-read and remove the front data item from a queue fronto read the front data item in a queue .size0-return the number of items in a queue isEmpty0-test if a queue is empty Write a C program that implements a queue with an array to store integer numbers. Notes: 1. You need to use an infinite loop and switch-case statement to prompt user to select and perform operations listed above, until user choose to exit your program. Queue operation functions should be implemented separately, instead of putting everything in the main function. 2. You need to use two variables, say frontIndext and taillndex, to track the first (front) item and last (tail) item in a queue. Initalize them to -1. When the first item is enqueued, set both to 0. After that, when you enqueue an item, increment the taillndex; when you dequeue an item, increment the forntlndex. 3. Very important: When you keep enqueuing and dequeuing. you may reach a state that all data elements are stored in the upper part of an array and the array cell with the highest index is occupied. In that case, new data should be added to the cell at index 0, and the queue is "wrapped around" Open With Print

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!