Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro Database Migration To Azure Data Modernization For The Enterprise

Authors: Kevin Kline, Denis McDowell, Dustin Dorsey, Matt Gordon

1st Edition

1484282299, 978-1484282298

More Books

Students also viewed these Databases questions

Question

=+Trainers from headquarters? Local trainers? Independent trainers?

Answered: 1 week ago