public class Trie extends Object
Modifier and Type | Class and Description |
---|---|
class |
Trie.Node
Trie Node
|
Constructor and Description |
---|
Trie()
Constructor
Initialize this as an empty trie
|
Modifier and Type | Method and Description |
---|---|
void |
add(String value)
Adds an input value to this trie
Before the value is added, a terminating character (U+0001) is appended to the input string
|
Trie.Node |
getRoot()
Returns this trie's root node
|
public void add(String value)
Before the value is added, a terminating character (U+0001) is appended to the input string
value
- value to add to this triepublic Trie.Node getRoot()
Copyright © 2020. All rights reserved.