Question: Update the method to print how many nodes were visited. 4 usages private T findEntry (BinaryNode rootNode, T anEntry) { } // TODO update this
Update the method to print how many nodes were visited.
4 usages private T findEntry (BinaryNode rootNode, T anEntry) { } // TODO update this method to print how many nodes were visited T result = null; if (rootNode != null) { } // We are not at a base case T rootEntry = rootNode.getData(); if (anEntry.equals(rootEntry)) { } result rootEntry; else if (anEntry.compareTo(rootEntry) < 0) else result = findEntry (rootNode.getLeftChild (), anEntry); result = findEntry (rootNode.getRightChild (), anEntry); return result;
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
