Tries


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Tries

Hybrid View

  1. #1
    Join Date
    Apr 2004
    Posts
    2

    Tries

    Hi everyone,
    I have been given a problem in which I have to implement a Trie that stores words.
    The important methods of the Trie are:
    getAllWords(): returns a String array of all the words in the Trie.
    hasWord(String s): returns whether the Trie has s or not
    hasPrefix(String p):returns whether the Trie contains p or not.
    I have made a TrieNode class. Each TrieNode has an array that stores 27 other TrieNodes(for 26 alphabets, and one to indicate the end of a word).A TrieNode also has a char value.

    Can someone pls implement the methods given above for me. I have tried a lot but I couldnt do them. The methods are to be done recursively.
    I have to find a solution to this problem by 12 noon tomorrow (apr 4, 12 noon (EST)).

    Any help would be greatly appreciated.
    P.S. the handout for the assignment is attatched with this message.

    Thanks.

  2. #2
    Join Date
    Apr 2004
    Posts
    2
    My mistake, there is no handout attatched with this message.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center