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

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!