diff --git a/src/main/java/com/dataStructures/BinaryTree.java b/src/main/java/com/dataStructures/BinaryTree.java index 1a35fed7..8cdb319c 100644 --- a/src/main/java/com/dataStructures/BinaryTree.java +++ b/src/main/java/com/dataStructures/BinaryTree.java @@ -1,4 +1,4 @@ -package dataStructures; +package src.main.java.com.dataStructures; /** * Binary tree for general value type, without redundancy @@ -76,7 +76,7 @@ public class BinaryTree { * @return true if this tree contains the data value, false if not. */ public boolean contains(T data){ - return !(this.search(data) == null); + return this.search(data) != null; } /** @@ -89,10 +89,10 @@ public class BinaryTree { System.out.println(this); - if (this.left!=null) - this.left.print(tabCounter+1); //it can't be ++ , pls don't change it - if (this.right!=null) - this.right.print(tabCounter+1); //it can't be ++ , pls don't change it + if (this.left != null) + this.left.print(tabCounter + 1); //it can't be ++ , pls don't change it + if (this.right != null) + this.right.print(tabCounter + 1); //it can't be ++ , pls don't change it } /** diff --git a/src/test/java/com/dataStructures/BinaryTreeTest.java b/src/test/java/com/dataStructures/BinaryTreeTest.java index cfc03559..b269441d 100644 --- a/src/test/java/com/dataStructures/BinaryTreeTest.java +++ b/src/test/java/com/dataStructures/BinaryTreeTest.java @@ -1,4 +1,4 @@ -package dataStructures; +package src.main.java.com.dataStructures; import org.junit.Test; import static org.junit.Assert.*;