Which of the following is a correct implementation of getFrequencyOf
public int getFrequencyOf(T anEntry) { int frequency = 0; Node currentNode = firstNode; while ((currentNode != null)) { if (anEntry.equals(currentNode.getData())) { frequency++; } // end if currentNode = currentNode.getNext(); } // end while return frequency; } // end getFrequencyOf
public int getFrequencyOf(T anEntry) { int frequency = 0; while ((currentNode != null)) { Node currentNode = firstNode; if (anEntry.equals(currentNode.getData())) { frequency++; } // end if currentNode = currentNode.getNext(); } // end while return frequency; } // end getFrequencyOf
public int getFrequencyOf(T anEntry) { Node currentNode = firstNode; while ((currentNode != null)) { if (anEntry.equals(currentNode.getData())) { frequency++; } // end if currentNode = currentNode.getNext(); } // end while return frequency; } // end getFrequencyOf
public int getFrequencyOf(T anEntry) { int frequency = 0; Node currentNode = firstNode; while ((currentNode != null)) { if (anEntry.equals(currentNode.getData())) { frequency++; } // end if currentNode++; } // end while return frequency; } // end getFrequencyOf
There are no hints for this question