Quiz: Inserting and Removing Arrays Continued
In the preceding video clip, Cay didn't actually go into detail how removal works. It works just like insertion, except that the elements are moved towards the beginning of the array. First you overwrite the element to be removed. You keep going until all values are moved:
for (int i = pos; i < size - 1; i++)
{
values[i] = values[i + 1];
}
size--;
| How many elements were visited? | 10 |