Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in C please! A. Implement the following functions for manipulating a queue (without actually declaring the queue), based on an array of characters of size

in C please!image text in transcribed

A. Implement the following functions for manipulating a queue (without actually declaring the queue), based on an array of characters of size QUEUESZ, where QUEUESZ is a #include value. The name of the queue is your choice. Pick a name. It will be declared in step B. a. Push - adds one element to the end of the queue (accepts a character as input), returns an int: i. -1 if the queue is already full, ii. O if the item was successfully added b. Pull - removes the front element (if it exists) and returns the value: i. NULL if there were no elements (queue was empty) ii. The Front element itself, if there was one c. Front - does NOT remove anything. Returns the value: i. NULL if there are no elements (queue is empty) ii. The front char element if there is one d. is Full - does NOT remove anything. Returns an int: i. -1 if there are no elements (the queue is empty) ii. 1 if the queue is full iii. O for all other cases B. Using the above functions, write a program that: a. Declares the queue with a size of QUEUESZ characters b. Uses your functions above to do the following: i. Accept input characters, 1 at a time until the symbol ^ is input ii. Push each character onto the queue iii. Output the queue (front to end) after all inputs have been received

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

More Books

Students also viewed these Databases questions