I am working with this bit of code for this question:
public boolean remove (T element) // Removes an element e from this list such that e.equals(element) // and returns true; if no such element exists, returns false. { find(element); if (found) { list[location] = list[numElements - 1]; list[numElements - 1] = null; numElements--; } return found; }
My educated guess is that this is of type O(1) since it doesn't matter how big the input, the time taken to complete the problem will remain constant. But is my logic correct? Does the fact that there's an extra step, which is the call to a different method, find(element); , change it to O(N)?