Question: write a code for tgis ( 2 5 points ) Q 1 . ( 1 3 points ) Implement the Queue data structure ( you

write a code for tgis
(25 points)
Q1.(13 points) Implement the Queue data structure (you can use linked list or circular array for implementation) with push(), pop(), front(), size() and empty() functions. The queue should be a template class (should work with any data type). Perform the following operations:
a) Instantiate the queue with integers and push 10 values into the queue
b) Display all the elements in a queue using just the queue functions mentioned above (push, pop, front, size etc.)
c) Write a new queue function called move_to_rear that moves the element currently at the front of the queue to the rear of the queue. The element that was second in line will be the new front element. Do this using functions push, front, and pop.
Q2.(5 points) Write a recursive linear search function with a recursive step that finds the last occurrence of a target in a vector, not the first. You will need to modify the linear search function (You can find it in the slides Lecture 9 slide 30).
Q3.(7 points) Modify the source code for the insertion sort so that it can sort a list (linked list or you can also use queue) of integers (You can find the source code on lecture 10 slide 138).
Submission guidelines:
You should have a header file and .cpp file. The header file should provide the function declaration and .cpp file should have implementation details.
All the functionality of the program should be implemented as functions and methods.
The code should be well commented
Create a report (readme file) that contains instruction on how to run the code and screen shots of the outputs
Upload your report and code files to GitHub.
Submit the GitHub link on Canvas by due date.
write a code for tgis ( 2 5 points ) Q 1 . ( 1 3

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 Programming Questions!