Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C++ Data Structures and Algorithms Here are the general project instructions: ht

ID: 665747 • Letter: C

Question

C++ Data Structures and Algorithms

Here are the general project instructions: https://ece.uwaterloo.ca/~dwharder/aads/Projects/2/

Here is the first class isntructions (Dynamic_queue) : https://ece.uwaterloo.ca/~dwharder/aads/Projects/2/Dynamic_queue/

Here are the first class Source Files: https://ece.uwaterloo.ca/~dwharder/aads/Projects/2/Dynamic_queue/src/

Here is the second class instructions (Linked_Stack ): https://ece.uwaterloo.ca/~dwharder/aads/Projects/2/Linked_stack/

Here are the second class source files: https://ece.uwaterloo.ca/~dwharder/aads/Projects/2/Linked_stack/src/

Please answer the question in full!! I appreciate your help!!

try and make everything super clear!

thanks!!

Explanation / Answer

1)Explanation of the Dequeue Source.

We have included three headerfiles as per the requirements in the projects.

Coming to the headerfile <iostreram.h> we have to execute the gzipped tar file by providing them in the command line,Where the object and the command are given as an input to execute the file.

As coming down to the public section we have the tester function where we have to pass the entire queue.

We call the process function where we will execute the functionality of enqueuing dequeing and rest of all the major functions that are acording to project requirements.

Now the line void Dynamic_queue_tester<Type>::process() executes and checks from the net line that which process have to be executed acordingly.

Now for first if() will create new queue with the default capacity of 10 by calling function dynamic queue<>.

Second if() statement will create a queue with the size given by the user in input value "n". and thus will create it by calling the same function.

For third if() it checks the size.The expected sze of the array is given as input by the user and checks whether it matches with the actual size.If the both the size are equal then it will print okay else it will print Failure in size with specific message.

Similarly for the next if() it checks the size of the array and now it calls the function object->capacity(); to again allocate the size.After it checks for the size compatibility and returs the message acordingly.

The next if() checks whether the queue is entirely full and do not have the next element.And hence by calling the functions checks the value of it.After checks the message is returned acordingly by cout<< statement.

The next if() functions returns the head element ie the first elemnt in the array of the queue.And it does so by calling the function object->head();.

The next if() checks for whether there is header node available or not.Hence the exception is thrown because the header node is empty.Underflow expression will be caught if there is no head.

The next if() performs the enqueue function i.e to add the element at the end of the queue.It passes the element to be queued and returns the final queue.

The next if() performs the dequeue operation where the element is removed from the top end.It checks for whether it is the only element that is left in the queue.Calls make to a function and hence the operation is performed.

The next if() performs the dequeue operation in the queue whre there are no element in the queue.thus gives the exception of underflow or prints the respective message.

The next if() will clear all the data from the queue and the queue will be empty.

the next if() will assign the values that are required to perform the various operations.AS the new dynamic object is created this passed to the testor to execute the possible.hence there is the run() that will help the function to execute. and if the command is out of the scope it will pop out the message as the invalid command.