Exploration 23.13.1.
(a)
Our initial state. We want to insert 15 at index 1.
The intList variable contains an m_size of 4 and m_capacity of 5. It also has a pointer to an array named m_arr. That array contains [10, 20, 30, 40, ???]
(b)
We work backwards using the loop counter
i which starts at m_size. At each location, we copy the value from m_arr[i - 1] to m_arr[i]. First we copy 40 from index 3 to index 4.
(c)
Now i is 3. We copy 30 from index 2 to index 3.
(d)
Now i is 2. We copy 20 from index 1 to index 2.
(e)
Now i is 1. That is the location we want to insert at. So we can stop our loop and place the new item (15) in this location.
(f)
Finally, we need to update the size of the ArrayList.
