SHARE
TWEET

Untitled

a guest May 19th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class TrieNode {
  2.     private List<TrieNode> children;
  3.     private boolean endOfWord;
  4.     private char letter;
  5.  
  6.     TrieNode() {
  7.         this.children = new List<>();
  8.         this.endOfWord = false;
  9.         this.letter ='\0';
  10.     }
  11.  
  12.     TrieNode(char character) {
  13.         this.children = new List<>();
  14.         this.endOfWord = false;
  15.         this.letter = character;
  16.     }
  17.  
  18.     public TrieNode(List value) {
  19.         this.children = value;
  20.         this.endOfWord = false;
  21.     }
  22.  
  23.     public List<TrieNode> getChildren() {
  24.  
  25.         return this.children;
  26.     }
  27.  
  28.     public void setChildren(List<TrieNode> children) {
  29.         this.children = children;
  30.     }
  31.  
  32.     public boolean getEndOfWord() {
  33.  
  34.         return this.endOfWord;
  35.     }
  36.  
  37.     public void setEndOfWord(boolean endOfWord) {
  38.  
  39.         this.endOfWord = endOfWord;
  40.     }
  41.  
  42.     public char getLetter() {
  43.         return this.letter;
  44.     }
  45.  
  46.     public void setLetter(char letter) {
  47.         this.letter = letter;
  48.     }
  49.  
  50.     @Override
  51.     public String toString() {
  52.         String s = "";
  53.         s += this.getLetter();
  54.         return s;
  55.     }
  56. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top