Class: DSA::Trie::Node

Inherits:
Struct
  • Object
show all
Defined in:
lib/dsa-ruby/trie.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeNode

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

#childrenObject

Returns the value of attribute children

Returns:

  • (Object)

    the current value of children



3
4
5
# File 'lib/dsa-ruby/trie.rb', line 3

def children
  @children
end

#word_endObject

Returns the value of attribute word_end

Returns:

  • (Object)

    the current value of word_end



3
4
5
# File 'lib/dsa-ruby/trie.rb', line 3

def word_end
  @word_end
end