made requested changes for binary tree implementation
This commit is contained in:
parent
2eec474f13
commit
4721cff668
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,4 +1,4 @@
|
||||
package dataStructures;
|
||||
package src.main.java.com.dataStructures;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
Loading…
Reference in New Issue
Block a user