Need help with trying to rewrite the getFrequencyOf method using recursion. I will provide the original non recursive code also. Try not to use the toArray method and use node chain.
Non-recursive method
public int getFrequencyOf(T anEntry) {int frequency = 0;int counter = 0;Node currentNode = firstNode;while ((counter < numberofentries)="" &&="" (currentnode="" !="null))">if (anEntry.equals(currentNode.data)) {frequency++;}counter++;currentNode = currentNode.next;}return frequency;}
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here