diff --git a/src/main/java/com/search/DepthFirstSearch.java b/src/main/java/com/search/DepthFirstSearch.java index 12ce4c11..64df6bfb 100644 --- a/src/main/java/com/search/DepthFirstSearch.java +++ b/src/main/java/com/search/DepthFirstSearch.java @@ -12,7 +12,6 @@ package src.main.java.com.search; * Best-case performance O(1) * Average performance O(n) * - * @author abir (https://github.com/abircb) */ public class DepthFirstSearch { @@ -35,14 +34,12 @@ public class DepthFirstSearch { * The BinaryTree class defines the structure of a binary tree * Also contains a static nested class called TreeNode * @param - * @author abir */ class BinaryTree> { private TreeNode root; /** - * @author abir * @param

* This class defines what a node in a binary tree looks like */ @@ -87,10 +84,10 @@ class BinaryTree> { * @return the tree node corresponding to the key */ private TreeNode

find(P key) { - if(key.compareTo(this.key) == 0) return this; + if (key.compareTo(this.key) == 0) return this; else if(key.compareTo(this.key) < 0) { - if(this.left == null) return null; + if (this.left == null) return null; else return this.left.find(key); }