Skip to content

Instantly share code, notes, and snippets.

@bragboy
Created June 24, 2016 12:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bragboy/beed42fe2fb71afea488591b602cf56b to your computer and use it in GitHub Desktop.
Save bragboy/beed42fe2fb71afea488591b602cf56b to your computer and use it in GitHub Desktop.
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