Question
In C: Declare two structures . The first one is a structure named Node. This structure will have two members: 1) a pointer to the
In C:
Declare two structures . The first one is a structure named Node. This structure will have two members: 1) a pointer to the string to store; and 2) a pointer to the next Node to build the queue. The second structure is named Queue. This structure will have a single member named front. This member is a pointer to the the first node in the queue.
Implement a function that constructs a Queue. The constructor allocates the Queue in the heap, and must return NULL when the constructor is not able to create a Queue. The Queue must be empty, and to signal this the front pointer must be NULL. Must have these parameters:
1. Name: CreateQueue
2. Return type: A pointer to the created Queue
Implement a function that destructs a Queue. The destructor deallocates all the elements present in the Queue, and sets the pointer to the Queue to NULL. Must have these parameters:
1. Name: DestroyQueue
2. Return type: void
3. Input: A double pointer to the queue to deallocate
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