Skip to content

Added DepthFirstSearch.java and DepthFirstTestSearch.java#737

Merged
yanglbme merged 4 commits into
TheAlgorithms:Developmentfrom
abircb:Development
May 11, 2019
Merged

Added DepthFirstSearch.java and DepthFirstTestSearch.java#737
yanglbme merged 4 commits into
TheAlgorithms:Developmentfrom
abircb:Development

Conversation

@abircb

@abircb abircb commented Apr 15, 2019

Copy link
Copy Markdown

Implemented the DepthFirstSearch in Java by creating a Binary Tree class and adding appropriate 'add' and 'get' methods. Also added a JUnit test :)

abircb added 3 commits April 15, 2019 11:14
this test is created for the DepthFirstSearch.java file- that I added- containing the DepthFirstSearch algorithm
Comment thread src/main/java/com/search/DepthFirstSearch.java Outdated
Comment thread src/main/java/com/search/DepthFirstSearch.java Outdated
Comment thread src/main/java/com/search/DepthFirstSearch.java Outdated
Comment thread src/main/java/com/search/DepthFirstSearch.java Outdated
Comment thread src/main/java/com/search/DepthFirstSearch.java
Comment thread src/main/java/com/search/DepthFirstSearch.java Outdated
Update DepthFirstSearch.java - signature removed, and whitespaces resolved

Co-Authored-By: Libin Yang <contact@yanglibin.info>
@yanglbme yanglbme merged commit af6daf7 into TheAlgorithms:Development May 11, 2019
import org.junit.Assert;
import org.junit.Test;
import src.main.java.com.search.DepthFirstSearch;
import src.main.java.com.search.BinaryTree;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'src.main.java.com.search.BinaryTree' is not public in 'src.main.java.com.search'. Cannot be accessed from outside package.

Assert.assertEquals("Incorrect index", null, DepthFirstSearch.find(8, tree1));
Assert.assertEquals("Incorrect index", null, DepthFirstSearch.find(-2, tree1));

BinaryTree<String> tree2 = new BinaryTree<String>();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
BinaryTree<String> tree2 = new BinaryTree<String>();
BinaryTree<String> tree2 = new BinaryTree<>();

@Test
public void testDepthFirstSearch() {

BinaryTree<Integer> tree1 = new BinaryTree<Integer>();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
BinaryTree<Integer> tree1 = new BinaryTree<Integer>();
BinaryTree<Integer> tree1 = new BinaryTree<>();

@yanglbme

Copy link
Copy Markdown
Member

Hi @abircb, I've revert the PR Added DepthFirstSearch.java and DepthFirstTestSearch.java #737

You can open a new pull request after fixing the problems.

@abircb

abircb commented May 20, 2019

Copy link
Copy Markdown
Author

Hi @yanglbme, I've just opened a new pull request- please check it out. And thanks for all the valuable feedback :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants