logo CodeStepByStep logo

Mirror

Language/Type: C# Queue collections

Write a method named Mirror that accepts 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.

Method: Write a C# method as described, not a complete program or class.

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.