Which of the following 4 implementations could not be used for contains?
public boolean contains(T anEntry) { Node currentNode = firstNode; while (!anEntry.equals(currentNode.getData())) { currentNode = currentNode.getNext(); } // end while return true; } // end contains
public boolean contains(T anEntry) { return getIndexOf(anEntry) > -1; }
public boolean contains(T anEntry) { return getFrequencyOf(anEntry) > 0; }
public boolean contains(T anEntry) { boolean found = false; Node currentNode = firstNode; while (!found && (currentNode != null)) { if (anEntry.equals(currentNode.getData())) found = true; else currentNode = currentNode.getNext(); } // end while return found; } // end contains
There are no hints for this question