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

Commitfa1503f

Browse files
abircbyanglbme
andauthored
Apply suggestions from code review
Update DepthFirstSearch.java - signature removed, and whitespaces resolvedCo-Authored-By: Libin Yang <contact@yanglibin.info>
1 parent785b570 commitfa1503f

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

‎src/main/java/com/search/DepthFirstSearch.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
* Best-case performanceO(1)
1313
* Average performance O(n)
1414
*
15-
* @author abir (https://github.com/abircb)
1615
*/
1716

1817
publicclassDepthFirstSearch {
@@ -35,14 +34,12 @@ public static <T extends Comparable<T>> T find(T key, BinaryTree<T> tree) {
3534
* The BinaryTree class defines the structure of a binary tree
3635
* Also contains a static nested class called TreeNode
3736
* @param <T>
38-
* @author abir
3937
*/
4038
classBinaryTree<TextendsComparable<T>> {
4139

4240
privateTreeNode<T>root;
4341

4442
/**
45-
* @author abir
4643
* @param <P>
4744
* This class defines what a node in a binary tree looks like
4845
*/
@@ -87,10 +84,10 @@ private void add(TreeNode<P> node) {
8784
* @return the tree node corresponding to the key
8885
*/
8986
privateTreeNode<P>find(Pkey) {
90-
if(key.compareTo(this.key) ==0)returnthis;
87+
if(key.compareTo(this.key) ==0)returnthis;
9188

9289
elseif(key.compareTo(this.key) <0) {
93-
if(this.left ==null)returnnull;
90+
if(this.left ==null)returnnull;
9491
elsereturnthis.left.find(key);
9592
}
9693

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp