Code the method whose header is given below. The method replaces a target element in an array. The pseudocode was given in Section 3.2.3.
What will be an ideal response?
```
void replace(Object[] array, Object target, Object replacement)
void replace (Object[] array, Object target, Object replacement)
{
int p = find(array, numElements, target);
if (p != -1)
{
array[p] = replacement;
}
}
```
Computer Science & Information Technology
You might also like to view...
You use the Date icon in the Design tab to add the current date to a report
Indicate whether the statement is true or false
Computer Science & Information Technology
This vector function returns the number of elements in a vector.
a. size b. num_elements c. elements d. length
Computer Science & Information Technology