프로퍼티 | 타입 | 설명 | |
---|---|---|---|
AddWord | void | ||
GetTrieNode | |||
GetWords | void | ||
Trie | System.Collections.Generic |
메소드 | 설명 | |
---|---|---|
AddWord ( string word ) : void |
Add a word to the Trie.
|
|
GetWords ( ) : ICollection |
Get all words in the Trie.
|
|
GetWords ( string prefix ) : ICollection |
Get words for given prefix.
|
|
HasWord ( string word ) : bool |
Returns true or false if the word is present in the Trie.
|
|
WordCount ( string word ) : int |
Returns the count for the word in the Trie.
|
메소드 | 설명 | |
---|---|---|
AddWord ( |
Recursive method to add word. Gets the first char of the word, creates the child TrieNode if null, and recurses with the first char removed from the word. If the word length is 0, return.
|
|
GetTrieNode ( string prefix ) : |
Get the equivalent TrieNode in the Trie for given prefix. If prefix not present, then return null.
|
|
GetWords ( |
Recursive method to get all the words starting from given TrieNode.
|
|
Trie ( |
Create a new Trie instance.
|