made requested changes for binary tree implementation

This commit is contained in:
Ricaro Guevara 2019-03-24 22:54:12 -05:00
parent 2eec474f13
commit 4721cff668
2 changed files with 7 additions and 7 deletions

View File

@ -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<T extends Comparable> {
* @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<T extends Comparable> {
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
}
/**

View File

@ -1,4 +1,4 @@
package dataStructures;
package src.main.java.com.dataStructures;
import org.junit.Test;
import static org.junit.Assert.*;