Class Trie


  • public class Trie
    extends java.lang.Object
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Trie.TrieNode  
    • Constructor Summary

      Constructors 
      Constructor Description
      Trie()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void insert​(java.lang.String word)  
      boolean search​(java.lang.String word)  
      boolean search​(java.lang.String word, Trie.TrieNode root, int idx)  
      boolean startsWith​(java.lang.String prefix)  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Trie

        public Trie()
    • Method Detail

      • insert

        public void insert​(java.lang.String word)
      • search

        public boolean search​(java.lang.String word)
      • search

        public boolean search​(java.lang.String word,
                              Trie.TrieNode root,
                              int idx)
      • startsWith

        public boolean startsWith​(java.lang.String prefix)