Class: DSA::Trie::Node
- Inherits:
-
Struct
- Object
- Struct
- DSA::Trie::Node
- Defined in:
- lib/dsa-ruby/trie.rb
Instance Attribute Summary collapse
-
#children ⇒ Object
Returns the value of attribute children.
-
#word_end ⇒ Object
Returns the value of attribute word_end.
Instance Method Summary collapse
-
#initialize ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize ⇒ Node
Returns a new instance of Node.
4 5 6 |
# File 'lib/dsa-ruby/trie.rb', line 4 def initialize super(children: {}, word_end: false) end |
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children
3 4 5 |
# File 'lib/dsa-ruby/trie.rb', line 3 def children @children end |
#word_end ⇒ Object
Returns the value of attribute word_end
3 4 5 |
# File 'lib/dsa-ruby/trie.rb', line 3 def word_end @word_end end |