is followed by
The elements of the array would be: 5, 6, 0, 10, 0. The first four integers would be considered valid elements. Thus, a call to
would yield valid elements: 5, 6, 8, 0, 10. That is, the insertion works as you would expect it to work. However, any call to insertElementAt will now require resizing of the array. For example,
requires a new array to be created, all the elements of the former array copied to the new array, fill to the right with zeros, and then perform the insert.
The result of the create new array, copy and fill will be: 5, 6, 8, 0, 10, 0, 0, 0, 0, 0, when the increment in the size of the array is 5 elements.
After the insertion, the elements will be: 5, 6, 8, 0, 13, 10, 0, 0, 0, 0. The valid elements of the array are: 5, 6, 8, 0, 13. The last four zeros are virtual (not really there).
(5) The test driver you write should have at least three arrays. Operations on these arrays should be interleaved.