Created
June 24, 2016 12:53
-
-
Save bragboy/beed42fe2fb71afea488591b602cf56b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dsa.tries; | |
import java.util.Collection; | |
import java.util.LinkedList; | |
/** | |
* @author Braga | |
*/ | |
public class Node { | |
char content; | |
boolean marker; | |
Collection<Node> child; | |
public Node(char c){ | |
child = new LinkedList<Node>(); | |
marker = false; | |
content = c; | |
} | |
public Node subNode(char c){ | |
if(child!=null){ | |
for(Node eachChild:child){ | |
if(eachChild.content == c){ | |
return eachChild; | |
} | |
} | |
} | |
return null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment