Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4721cff

Browse files
made requested changes for binary tree implementation
1 parent2eec474 commit4721cff

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

‎src/main/java/com/dataStructures/BinaryTree.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
packagedataStructures;
1+
packagesrc.main.java.com.dataStructures;
22

33
/**
44
* Binary tree for general value type, without redundancy
@@ -76,7 +76,7 @@ public BinaryTree search(T data){
7676
* @return true if this tree contains the data value, false if not.
7777
*/
7878
publicbooleancontains(Tdata){
79-
return!(this.search(data)==null);
79+
returnthis.search(data)!=null;
8080
}
8181

8282
/**
@@ -89,10 +89,10 @@ private void print(int tabCounter){
8989

9090
System.out.println(this);
9191

92-
if (this.left!=null)
93-
this.left.print(tabCounter+1);//it can't be ++ , pls don't change it
94-
if (this.right!=null)
95-
this.right.print(tabCounter+1);//it can't be ++ , pls don't change it
92+
if (this.left !=null)
93+
this.left.print(tabCounter +1);//it can't be ++ , pls don't change it
94+
if (this.right !=null)
95+
this.right.print(tabCounter +1);//it can't be ++ , pls don't change it
9696
}
9797

9898
/**

‎src/test/java/com/dataStructures/BinaryTreeTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
packagedataStructures;
1+
packagesrc.main.java.com.dataStructures;
22

33
importorg.junit.Test;
44
importstaticorg.junit.Assert.*;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp