-
Notifications
You must be signed in to change notification settings - Fork 20.3k
Added DepthFirstSearch.java and DepthFirstTestSearch.java #737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
this test is created for the DepthFirstSearch.java file- that I added- containing the DepthFirstSearch algorithm
Update DepthFirstSearch.java - signature removed, and whitespaces resolved Co-Authored-By: Libin Yang <contact@yanglibin.info>
import org.junit.Assert; | ||
import org.junit.Test; | ||
import src.main.java.com.search.DepthFirstSearch; | ||
import src.main.java.com.search.BinaryTree; |
There was a problem hiding this comment.
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>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BinaryTree<String> tree2 = new BinaryTree<String>(); | |
BinaryTree<String> tree2 = new BinaryTree<>(); |
@Test | ||
public void testDepthFirstSearch() { | ||
|
||
BinaryTree<Integer> tree1 = new BinaryTree<Integer>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BinaryTree<Integer> tree1 = new BinaryTree<Integer>(); | |
BinaryTree<Integer> tree1 = new BinaryTree<>(); |
Hi @abircb, I've revert the PR You can open a new pull request after fixing the problems. |
Hi @yanglbme, I've just opened a new pull request- please check it out. And thanks for all the valuable feedback :) |
Implemented the DepthFirstSearch in Java by creating a Binary Tree class and adding appropriate 'add' and 'get' methods. Also added a JUnit test :)