Write a method called mirror that doubles the size of a list by appending the mirror image
Question:
Write a method called mirror that doubles the size of a list by appending the mirror image of the original sequence to the end of the list. The mirror image is the same sequence of values in reverse order. For example, if a variable called list stores [1, 3, 2, 7] and the client calls list.mirror(); then the list should be changed to store [1, 3, 2, 7, 7, 2, 3, 1]. Notice that it has doubled in size because the original sequence now appears in reverse order at the end of the list.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Building Java Programs A Back To Basics Approach
ISBN: 9780135471944
5th Edition
Authors: Stuart Reges, Marty Stepp
Question Posted: