Question: Exercise 5 .1 ( 3 0 points) Create a queue with some data elements, and finish such operations as initialization, EnQueue , DeQueue , etc.

Exercise 5.1 (30 points)

Create a queue with some data elements, and finish such operations as initialization, EnQueue, DeQueue, etc.

All operations should be implemented as independent functions, which can be called by the main function.

(1) Create a queue by entering some positive integer data elements, and end the process by entering -1, and output all the elements;
(2) Get the length of the queue;
(3) Delete a data element from the queue, and output the data value.

3.2 Linked List Based Implementation of Queue

Exercise 5.2 (30 points)

Create a queue with some data elements, and finish such operations as initialization, Push, Pop, etc.

All operations should be implemented as independent functions, which can be called by the main function.

(1) Create a queue by entering some positive integer data elements, and end the process by entering -1, and output all the elements;
(2) Get the length of the queue
(3) Add a new data element into the queue;
(4) Delete a data element from the queue, and output the data value

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!