1212 * Best-case performanceO(1)
1313 * Average performance O(n)
1414 *
15- * @author abir (https://github.com/abircb)
1615 */
1716
1817public class DepthFirstSearch {
@@ -35,14 +34,12 @@ public static <T extends Comparable<T>> T find(T key, BinaryTree<T> tree) {
3534 * The BinaryTree class defines the structure of a binary tree
3635 * Also contains a static nested class called TreeNode
3736 * @param <T>
38- * @author abir
3937 */
4038class BinaryTree <T extends Comparable <T >> {
4139
4240private TreeNode <T >root ;
4341
4442/**
45- * @author abir
4643 * @param <P>
4744 * This class defines what a node in a binary tree looks like
4845 */
@@ -87,10 +84,10 @@ private void add(TreeNode<P> node) {
8784 * @return the tree node corresponding to the key
8885 */
8986private TreeNode <P >find (P key ) {
90- if (key .compareTo (this .key ) ==0 )return this ;
87+ if (key .compareTo (this .key ) ==0 )return this ;
9188
9289else if (key .compareTo (this .key ) <0 ) {
93- if (this .left ==null )return null ;
90+ if (this .left ==null )return null ;
9491else return this .left .find (key );
9592}
9693