Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C++ write a program that creates an array of linked list queues and then your main queue must be an array implementation of a

In C++ write a program that creates an array of linked list queues and then your main queue must be an array implementation of a queue using the circular queue (keeping a head and tail index). DO NOT USE STANDARD TEMPLATE LIBRARY!

image text in transcribed

Your program must have the following methods for the main circular queue: enqueue (q_t) will add a linked list queue (q t) to the next available spot in your circular queue dequeue() will remove the next linked list queue in circular array by first printing out everything in that q t then deleting it. enqueue (int, char) Will add to the given index's linked list a character to that queue * Will add to the last linked list of the circular queue a character (to enqueuenext (char) the end of that queue) For example if to the picture I did enqueuenext ('Fit would add it after the e. . resizequeue() Will multiply the circual queue's array size by two, then copy over to that new array. Make this efficient by just moving pointers to your lists rather than recreating the linked lists. createcircularqueue (int) Creates your initial circular queue with a given input size . createqueue () Will create a linked list queue that you can then enqueue to the circular * array. Make sure you also add functions to enqueue and dequeue to this queue before adding it print () Print out the current circular queue and the elements of each linked lists. Sample: Circular Queue (Size: 11): Index 0: J, K, L, M, N Index 1: O, P, Q, R, S Index 2: a, b, c, a, e Index 3: Empty Index 10: Empty Make sure you test your code thoroughly and provide a main class along with your queue classes that test the functionality of your code so the TA can test it. Document your code and provide print statements that show what is happening on your code after each dequeue or enqueue. Reminder: DO NOT USE STL To complete assignment. Your program must have the following methods for the main circular queue: enqueue (q_t) will add a linked list queue (q t) to the next available spot in your circular queue dequeue() will remove the next linked list queue in circular array by first printing out everything in that q t then deleting it. enqueue (int, char) Will add to the given index's linked list a character to that queue * Will add to the last linked list of the circular queue a character (to enqueuenext (char) the end of that queue) For example if to the picture I did enqueuenext ('Fit would add it after the e. . resizequeue() Will multiply the circual queue's array size by two, then copy over to that new array. Make this efficient by just moving pointers to your lists rather than recreating the linked lists. createcircularqueue (int) Creates your initial circular queue with a given input size . createqueue () Will create a linked list queue that you can then enqueue to the circular * array. Make sure you also add functions to enqueue and dequeue to this queue before adding it print () Print out the current circular queue and the elements of each linked lists. Sample: Circular Queue (Size: 11): Index 0: J, K, L, M, N Index 1: O, P, Q, R, S Index 2: a, b, c, a, e Index 3: Empty Index 10: Empty Make sure you test your code thoroughly and provide a main class along with your queue classes that test the functionality of your code so the TA can test it. Document your code and provide print statements that show what is happening on your code after each dequeue or enqueue. Reminder: DO NOT USE STL To complete assignment

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

Students also viewed these Databases questions