create a new array with element i set to v. Grow the array in case i == length.Complexity: O(array.this.length)