Question: c++ write the all code that inserts item into the queue as the nth element (counting from the front, which is element 1), leaving the

c++ write the all code
that inserts item into the queue as the nth element (counting from the front, which is element 1), leaving the order of all other elements unchanged. If n has value q.size() +1, cut() inserts item at the back of the queue. The function throws the rangeError exception if n q.size() +1. The figure illustrates the action of cut() for an integer queue, n=4, and item =9 n=4(4thelementofqueue),iitem=9 Refnre front back
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
