Question: In C++ write a main program that uses the list based queue class (defined below) to check if an input string is of the form

In C++ write a main program that uses the list based queue class (defined below) to check if an input string is of the form anbnan meaning n times the character a followed by n times the character b followed by n times the character a. For example, consider: aaaabbbbbbaaaa vs. aaabbbaa or abaabbab

You should modularize program using: AnBnAn.cpp, LQ.cpp and LQ.h.

Write a class LLQ that implements a Queue in linked a list of characters. The class should include the following utilities:

1.A constructor and a destructor.

2. At least one inline getter and one inline setter for private members

3. An insert function that gets a character value and inserts it at the end of the queue

4. A remove function that gets the value of the first queue element and stores it in a character variable

5. A Boolean function is_full that returns trueif the queue is full (otherwise it returns false). This function should be called before inserting items to the queue.

6. A Boolean function is_empty that returns true if the queue is empty (otherwise it returns false). This function should be called before removing items from the queue

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!