Levels Tought:
Elementary,Middle School,High School,College,University,PHD
Teaching Since: | Apr 2017 |
Last Sign in: | 10 Weeks Ago |
Questions Answered: | 4870 |
Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Due date is Friday July 22, 2016 at 2:30 pm  but I have to hand in a hard copy as well so 1:30 pm would be the actual due time.
Â
Asn 3 – Due July 22nd, 2016 (2:30pm)Problem 1 [10 marks]Consider the Queue ADT discussed in class along with its datum and list of operations:-print(Q)Prints out the sequence of data from the front of the queue to the back.-enqueue(Q,x)Puts the data x into the back of the queue-dequeue(Q)Returns and removes the data from the front of the queue-isEmpty(Q)Returns 0 (false) or 1 (true) depending on whether the queue is empty-size(Q)Returns an unsigned integer representing the number of elements in the queue-peek(Q)Returns the next data to be dequeued but doesn’t actually dequeue it (it takes a ‘peek’)You are to write a C program that creates a Queue datatype with an array of integers (among otherattributes). Using the operations available for a C array, implement each one of the functions describedabove (some are more straight forward than others). Please note that C only has static arrays, yourimplementation must take that into account (especially when executing enqueue and dequeue).Here is the start of your structure.typedef struct {int * data;// array of the data on the queue…} queue_t;In your code, you should also include a test case that tests each one of these functions.
Attachments:-----------