Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started