logo CodeStepByStep logo

mirror

Language/Type: C++ queue collections STL
Related Links:

Write a function named mirror that accepts a reference to a queue of strings as a parameter and appends the queue's contents to itself in reverse order. For example, if a queue named q stores {"a", "b", "c"}, the call of mirror(q); should change it to store {"a", "b", "c", "c", "b", "a"}.

Constraints: You may declare a single stack or queue as auxiliary storage.

Function: Write a C++ function as described, not a complete program.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.