Write a method doubleUp that doubles the size of a list of integers by doubling-up each element in the list. Assume there's enough space in the array to double the size.
Suppose a list stores the values [1, 3, 2, 7]. After calling list.doubleUp(), the list should store the values [1, 1, 3, 3, 2, 2, 7, 7]
This assignment has been answered 3 times in private sessions.
Or buy a ready solution below.
© 2021 Codify Tutor. All rights reserved